Explorar o código

Merge branch 'master' into integration

Yilun Chong %!s(int64=6) %!d(string=hai) anos
pai
achega
429d2ae19f
Modificáronse 100 ficheiros con 379 adicións e 682 borrados
  1. 1 0
      Makefile.am
  2. 16 16
      benchmarks/Makefile.am
  3. 4 4
      benchmarks/README.md
  4. 13 13
      benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java
  5. 3 3
      benchmarks/js/benchmark_suite.js
  6. 6 6
      benchmarks/js/js_benchmark.js
  7. 7 7
      benchmarks/php/PhpBenchmark.php
  8. 5 5
      benchmarks/protobuf.js/protobufjs_benchmark.js
  9. 4 4
      benchmarks/python/py_benchmark.py
  10. 1 1
      benchmarks/util/result_parser.py
  11. 2 2
      benchmarks/util/result_uploader.py
  12. 7 7
      cmake/README.md
  13. 1 1
      cmake/protobuf-config.cmake.in
  14. 1 1
      cmake/version.rc.in
  15. 6 6
      conformance/ConformanceJava.java
  16. 1 1
      conformance/conformance_ruby.rb
  17. 10 10
      conformance/third_party/jsoncpp/json.h
  18. 10 10
      conformance/third_party/jsoncpp/jsoncpp.cpp
  19. 9 9
      csharp/CHANGES.txt
  20. 13 13
      csharp/README.md
  21. 5 5
      csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto
  22. 2 2
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/MapFieldTest.cs
  23. 1 1
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
  24. 2 2
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
  25. 5 5
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonTokenizerTest.cs
  26. 2 2
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
  27. 1 1
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs
  28. 1 1
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleEnum.cs
  29. 1 1
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs
  30. 2 2
      csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs
  31. 5 5
      csharp/protos/unittest_issues.proto
  32. 2 2
      csharp/protos/unittest_proto3.proto
  33. 3 9
      csharp/src/AddressBook/Addressbook.cs
  34. 4 12
      csharp/src/Google.Protobuf.Conformance/Conformance.cs
  35. 4 4
      csharp/src/Google.Protobuf.Conformance/Program.cs
  36. 2 2
      csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs
  37. 1 1
      csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs
  38. 1 1
      csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
  39. 2 2
      csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs
  40. 1 1
      csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj
  41. 1 1
      csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs
  42. 5 5
      csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs
  43. 2 2
      csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs
  44. 1 1
      csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs
  45. 1 1
      csharp/src/Google.Protobuf.Test/SampleEnum.cs
  46. 1 1
      csharp/src/Google.Protobuf.Test/SampleNaNs.cs
  47. 7 21
      csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs
  48. 3 9
      csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs
  49. 21 63
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs
  50. 1 3
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs
  51. 1 3
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs
  52. 13 39
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs
  53. 39 117
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs
  54. 4 12
      csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs
  55. 2 2
      csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs
  56. 2 2
      csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs
  57. 2 2
      csharp/src/Google.Protobuf/FieldCodec.cs
  58. 3 3
      csharp/src/Google.Protobuf/FieldMaskTree.cs
  59. 2 2
      csharp/src/Google.Protobuf/Google.Protobuf.csproj
  60. 4 4
      csharp/src/Google.Protobuf/JsonFormatter.cs
  61. 2 2
      csharp/src/Google.Protobuf/JsonParser.cs
  62. 2 2
      csharp/src/Google.Protobuf/JsonTokenizer.cs
  63. 1 1
      csharp/src/Google.Protobuf/LimitedInputStream.cs
  64. 3 3
      csharp/src/Google.Protobuf/MessageExtensions.cs
  65. 2 2
      csharp/src/Google.Protobuf/MessageParser.cs
  66. 3 3
      csharp/src/Google.Protobuf/Reflection/CustomOptions.cs
  67. 19 57
      csharp/src/Google.Protobuf/Reflection/Descriptor.cs
  68. 1 1
      csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs
  69. 1 1
      csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs
  70. 2 2
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
  71. 1 1
      csharp/src/Google.Protobuf/Reflection/IDescriptor.cs
  72. 1 1
      csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs
  73. 1 1
      csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs
  74. 1 1
      csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs
  75. 1 1
      csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs
  76. 2 2
      csharp/src/Google.Protobuf/UnknownField.cs
  77. 0 23
      csharp/src/Google.Protobuf/UnknownFieldSet.cs
  78. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
  79. 1 1
      csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs
  80. 3 9
      csharp/src/Google.Protobuf/WellKnownTypes/Api.cs
  81. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs
  82. 1 1
      csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs
  83. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs
  84. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs
  85. 1 1
      csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs
  86. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs
  87. 3 9
      csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs
  88. 1 3
      csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs
  89. 5 15
      csharp/src/Google.Protobuf/WellKnownTypes/Type.cs
  90. 9 27
      csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs
  91. 1 1
      docs/options.md
  92. 4 4
      docs/performance.md
  93. 3 2
      docs/third_party.md
  94. 1 1
      examples/list_people_test.go
  95. 1 1
      java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_optimize_for.proto
  96. 1 1
      java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_optimize_for.proto
  97. 3 3
      java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ByteStringTest.java
  98. 6 6
      java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DeprecatedFieldTest.java
  99. 4 4
      java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DescriptorsTest.java
  100. 1 1
      java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/GeneratedMessageTest.java

+ 1 - 0
Makefile.am

@@ -951,6 +951,7 @@ ruby_EXTRA_DIST=                                                             \
   ruby/tests/test_ruby_package.proto                                         \
   ruby/tests/test_ruby_package.proto                                         \
   ruby/tests/generated_code_test.rb                                          \
   ruby/tests/generated_code_test.rb                                          \
   ruby/tests/well_known_types_test.rb                                        \
   ruby/tests/well_known_types_test.rb                                        \
+  ruby/tests/type_errors.rb                                                  \
   ruby/travis-test.sh
   ruby/travis-test.sh
 
 
 js_EXTRA_DIST=                                                         \
 js_EXTRA_DIST=                                                         \

+ 16 - 16
benchmarks/Makefile.am

@@ -126,7 +126,7 @@ java_benchmark_testing_files =                                      \
 	java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java
 	java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java
 
 
 javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2
 javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2
-	cp -r $(srcdir)/java tmp 
+	cp -r $(srcdir)/java tmp
 	mkdir -p tmp/java/lib
 	mkdir -p tmp/java/lib
 	cp $(top_srcdir)/java/core/target/*.jar tmp/java/lib/protobuf-java.jar
 	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 ../..
 	cd tmp/java && mvn clean compile assembly:single -Dprotobuf.version=$(PACKAGE_VERSION) && cd ../..
@@ -253,7 +253,7 @@ go_protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks
 	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message4) )
 	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
 	touch go_protoc_middleman
 
 
-go-benchmark: go_protoc_middleman 
+go-benchmark: go_protoc_middleman
 	@echo "Writing shortcut script go-benchmark..."
 	@echo "Writing shortcut script go-benchmark..."
 	@echo '#! /bin/bash' > go-benchmark
 	@echo '#! /bin/bash' > go-benchmark
 	@echo 'cd $(srcdir)/go' >> go-benchmark
 	@echo 'cd $(srcdir)/go' >> go-benchmark
@@ -265,7 +265,7 @@ go-benchmark: go_protoc_middleman
 	@echo 'cd ..' >> go-benchmark
 	@echo 'cd ..' >> go-benchmark
 	@chmod +x go-benchmark
 	@chmod +x go-benchmark
 
 
-go: go_protoc_middleman go-benchmark 
+go: go_protoc_middleman go-benchmark
 	./go-benchmark $(all_data)
 	./go-benchmark $(all_data)
 
 
 ############# GO RULES END ##############
 ############# GO RULES END ##############
@@ -322,9 +322,9 @@ $(cpp_no_group_benchmarks_protoc_outputs_proto2_header): cpp_no_group_protoc_mid
 generate_cpp_no_group_benchmark_code:
 generate_cpp_no_group_benchmark_code:
 	cp $(srcdir)/cpp/cpp_benchmark.cc gogo/cpp_no_group/cpp_benchmark.cc
 	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 \"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  
+	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
 	touch generate_cpp_no_group_benchmark_code
-	
+
 bin_PROGRAMS += cpp-no-group-benchmark
 bin_PROGRAMS += cpp-no-group-benchmark
 cpp_no_group_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
 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_SOURCES = gogo/cpp_no_group/cpp_benchmark.cc
@@ -343,7 +343,7 @@ nodist_cpp_no_group_benchmark_SOURCES =                                    \
 
 
 cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark
 cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark
 	./cpp-no-group-benchmark $(gogo_data)
 	./cpp-no-group-benchmark $(gogo_data)
- 
+
 gogo_proto_middleman: protoc-gen-gogoproto
 gogo_proto_middleman: protoc-gen-gogoproto
 	mkdir -p "tmp/gogo_proto"
 	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) )
 	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) )
@@ -355,7 +355,7 @@ generate_gogo_data: protoc_middleman protoc_middleman2 gogo-data-scrubber
 	mkdir -p `dirname $(gogo_data)`
 	mkdir -p `dirname $(gogo_data)`
 	./gogo-data-scrubber $(all_data) $(gogo_data)
 	./gogo-data-scrubber $(all_data) $(gogo_data)
 	touch generate_gogo_data
 	touch generate_gogo_data
-	
+
 make_tmp_dir_gogo:
 make_tmp_dir_gogo:
 	mkdir -p tmp/go_no_group/benchmark_code
 	mkdir -p tmp/go_no_group/benchmark_code
 	mkdir -p tmp/gogofast/benchmark_code
 	mkdir -p tmp/gogofast/benchmark_code
@@ -435,10 +435,10 @@ gogo-benchmark:
 
 
 go_no_group: go_no_group_protoc_middleman generate_gogo_data generate_all_gogo_benchmark_code 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)
 	./gogo-benchmark go_no_group $(gogo_data)
-	
-gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code 
+
+gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
 	./gogo-benchmark gogofast $(gogo_data)
 	./gogo-benchmark gogofast $(gogo_data)
-	
+
 gogofaster: gogofaster_protoc_middleman  generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
 gogofaster: gogofaster_protoc_middleman  generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
 	./gogo-benchmark gogofaster $(gogo_data)
 	./gogo-benchmark gogofaster $(gogo_data)
 
 
@@ -448,7 +448,7 @@ gogoslick: gogoslick_protoc_middleman  generate_gogo_data gogo-benchmark generat
 
 
 ############# GOGO RULES END ############
 ############# GOGO RULES END ############
 
 
- 
+
 ############ UTIL RULES BEGIN ############
 ############ UTIL RULES BEGIN ############
 
 
 bin_PROGRAMS += protoc-gen-gogoproto gogo-data-scrubber protoc-gen-proto2_to_proto3 proto3-data-stripper
 bin_PROGRAMS += protoc-gen-gogoproto gogo-data-scrubber protoc-gen-proto2_to_proto3 proto3-data-stripper
@@ -481,7 +481,7 @@ nodist_proto3_data_stripper_SOURCES =                                      \
 	$(benchmarks_protoc_outputs_proto2_header)                               \
 	$(benchmarks_protoc_outputs_proto2_header)                               \
 	$(benchmarks_protoc_outputs_header)
 	$(benchmarks_protoc_outputs_header)
 
 
-	
+
 ############ UTIL RULES END ############
 ############ UTIL RULES END ############
 
 
 ############ PROTO3 PREPARATION BEGIN #############
 ############ PROTO3 PREPARATION BEGIN #############
@@ -510,7 +510,7 @@ proto3_middleman_php: proto3_proto_middleman
 
 
 php-benchmark: proto3_middleman_php generate_proto3_data
 php-benchmark: proto3_middleman_php generate_proto3_data
 	mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
 	mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
-	cp php/autoload.php "tmp/php"  
+	cp php/autoload.php "tmp/php"
 	@echo "Writing shortcut script php-benchmark..."
 	@echo "Writing shortcut script php-benchmark..."
 	@echo '#! /bin/bash' > php-benchmark
 	@echo '#! /bin/bash' > php-benchmark
 	@echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark
 	@echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark
@@ -527,8 +527,8 @@ php_c_extension:
 	cd $(top_srcdir)/php/ext/google/protobuf && phpize && ./configure CFLAGS='-O3' && make -j8
 	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
 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"  
+	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 "Writing shortcut script php-c-benchmark..."
 	@echo '#! /bin/bash' > 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_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-c-benchmark
@@ -654,4 +654,4 @@ CLEANFILES =                                                               \
 
 
 clean-local:
 clean-local:
 	-rm -rf tmp/*
 	-rm -rf tmp/*
-	
+

+ 4 - 4
benchmarks/README.md

@@ -3,7 +3,7 @@
 
 
 This directory contains benchmarking schemas and data sets that you
 This directory contains benchmarking schemas and data sets that you
 can use to test a variety of performance scenarios against your
 can use to test a variety of performance scenarios against your
-protobuf language runtime. If you are looking for performance 
+protobuf language runtime. If you are looking for performance
 numbers of officially support languages, see [here](
 numbers of officially support languages, see [here](
 https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md)
 https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md)
 
 
@@ -45,8 +45,8 @@ And you also need to make sure `pkg-config` is installed.
 
 
 ### Go
 ### Go
 Go protobufs are maintained at [github.com/golang/protobuf](
 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. 
+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:
 To install protoc-gen-go, run:
 
 
@@ -59,7 +59,7 @@ The first command installs `protoc-gen-go` into the `bin` directory in your loca
 The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later.
 The second command adds the `bin` directory to your `PATH` so that `protoc` can locate the plugin later.
 
 
 ### PHP
 ### PHP
-PHP benchmark's requirement is the same as PHP protobuf's requirements. The benchmark will automaticly 
+PHP benchmark's requirement is the same as PHP protobuf's requirements. The benchmark will automaticly
 include PHP protobuf's src and build the c extension if required.
 include PHP protobuf's src and build the c extension if required.
 
 
 ### Node.js
 ### Node.js

+ 13 - 13
benchmarks/java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java

@@ -24,8 +24,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 // Caliper set CICompilerCount to 1 for making sure compilation doesn't run in parallel with itself,
 // 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: 
+// 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
 // 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.
 // But this haven't been added into most recent release.
 @VmOptions("-XX:-TieredCompilation")
 @VmOptions("-XX:-TieredCompilation")
@@ -89,7 +89,7 @@ public class ProtoCaliperBenchmark {
         return com.google.protobuf.benchmarks.BenchmarkMessage4.GoogleMessage4.getDefaultInstance();
         return com.google.protobuf.benchmarks.BenchmarkMessage4.GoogleMessage4.getDefaultInstance();
       }
       }
     };
     };
-    
+
     abstract ExtensionRegistry getExtensionRegistry();
     abstract ExtensionRegistry getExtensionRegistry();
     abstract Message getDefaultInstance();
     abstract Message getDefaultInstance();
   }
   }
@@ -97,7 +97,7 @@ public class ProtoCaliperBenchmark {
   private BenchmarkMessageType benchmarkMessageType;
   private BenchmarkMessageType benchmarkMessageType;
   @Param("")
   @Param("")
   private String dataFile;
   private String dataFile;
-  
+
   private byte[] inputData;
   private byte[] inputData;
   private BenchmarkDataset benchmarkDataset;
   private BenchmarkDataset benchmarkDataset;
   private Message defaultMessage;
   private Message defaultMessage;
@@ -125,7 +125,7 @@ public class ProtoCaliperBenchmark {
           + benchmarkDataset.getMessageName());
           + benchmarkDataset.getMessageName());
     }
     }
   }
   }
-  
+
   @BeforeExperiment
   @BeforeExperiment
   void setUp() throws IOException {
   void setUp() throws IOException {
     if (!dataFile.equals("")) {
     if (!dataFile.equals("")) {
@@ -145,7 +145,7 @@ public class ProtoCaliperBenchmark {
     inputStreamList = new ArrayList<ByteArrayInputStream>();
     inputStreamList = new ArrayList<ByteArrayInputStream>();
     inputStringList = new ArrayList<ByteString>();
     inputStringList = new ArrayList<ByteString>();
     sampleMessageList = new ArrayList<Message>();
     sampleMessageList = new ArrayList<Message>();
-    
+
     for (int i = 0; i < benchmarkDataset.getPayloadCount(); i++) {
     for (int i = 0; i < benchmarkDataset.getPayloadCount(); i++) {
       byte[] singleInputData = benchmarkDataset.getPayload(i).toByteArray();
       byte[] singleInputData = benchmarkDataset.getPayload(i).toByteArray();
       inputDataList.add(benchmarkDataset.getPayload(i).toByteArray());
       inputDataList.add(benchmarkDataset.getPayload(i).toByteArray());
@@ -156,8 +156,8 @@ public class ProtoCaliperBenchmark {
           defaultMessage.newBuilderForType().mergeFrom(singleInputData, extensions).build());
           defaultMessage.newBuilderForType().mergeFrom(singleInputData, extensions).build());
     }
     }
   }
   }
-  
-  
+
+
   @Benchmark
   @Benchmark
   void serializeToByteArray(int reps) throws IOException {
   void serializeToByteArray(int reps) throws IOException {
     if (sampleMessageList.size() == 0) {
     if (sampleMessageList.size() == 0) {
@@ -165,11 +165,11 @@ public class ProtoCaliperBenchmark {
     }
     }
     for (int i = 0; i < reps; i++) {
     for (int i = 0; i < reps; i++) {
       for (int j = 0; j < sampleMessageList.size(); j++) {
       for (int j = 0; j < sampleMessageList.size(); j++) {
-        sampleMessageList.get(j).toByteArray();  
+        sampleMessageList.get(j).toByteArray();
       }
       }
     }
     }
   }
   }
-  
+
   @Benchmark
   @Benchmark
   void serializeToMemoryStream(int reps) throws IOException {
   void serializeToMemoryStream(int reps) throws IOException {
     if (sampleMessageList.size() == 0) {
     if (sampleMessageList.size() == 0) {
@@ -178,11 +178,11 @@ public class ProtoCaliperBenchmark {
     for (int i = 0; i < reps; i++) {
     for (int i = 0; i < reps; i++) {
       for (int j = 0; j < sampleMessageList.size(); j++) {
       for (int j = 0; j < sampleMessageList.size(); j++) {
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         ByteArrayOutputStream output = new ByteArrayOutputStream();
-        sampleMessageList.get(j).writeTo(output); 
+        sampleMessageList.get(j).writeTo(output);
       }
       }
     }
     }
   }
   }
-  
+
   @Benchmark
   @Benchmark
   void deserializeFromByteArray(int reps) throws IOException {
   void deserializeFromByteArray(int reps) throws IOException {
     if (inputDataList.size() == 0) {
     if (inputDataList.size() == 0) {
@@ -195,7 +195,7 @@ public class ProtoCaliperBenchmark {
       }
       }
     }
     }
   }
   }
-  
+
   @Benchmark
   @Benchmark
   void deserializeFromMemoryStream(int reps) throws IOException {
   void deserializeFromMemoryStream(int reps) throws IOException {
     if (inputStreamList.size() == 0) {
     if (inputStreamList.size() == 0) {

+ 3 - 3
benchmarks/js/benchmark_suite.js

@@ -9,8 +9,8 @@ function newBenchmark(messageName, filename, language) {
       })
       })
       .on("start", function() {
       .on("start", function() {
           process.stdout.write(
           process.stdout.write(
-            "benchmarking message " + messageName 
-            + " of dataset file " + filename 
+            "benchmarking message " + messageName
+            + " of dataset file " + filename
             + "'s performance ..." + "\n\n");
             + "'s performance ..." + "\n\n");
       })
       })
       .on("cycle", function(event) {
       .on("cycle", function(event) {
@@ -21,7 +21,7 @@ function newBenchmark(messageName, filename, language) {
             return 1 / (bench.stats.mean + bench.stats.moe);
             return 1 / (bench.stats.mean + bench.stats.moe);
           }
           }
           benches.forEach(function(val, index) {
           benches.forEach(function(val, index) {
-            benches[index] = getHz(val); 
+            benches[index] = getHz(val);
           });
           });
       }),
       }),
      benches: benches
      benches: benches

+ 6 - 6
benchmarks/js/js_benchmark.js

@@ -30,7 +30,7 @@ process.argv.forEach(function(filename, index) {
     json_file = filename.replace(/^--json_output=/, '');
     json_file = filename.replace(/^--json_output=/, '');
     return;
     return;
   }
   }
-  
+
   var benchmarkDataset =
   var benchmarkDataset =
       proto.benchmarks.BenchmarkDataset.deserializeBinary(fs.readFileSync(filename));
       proto.benchmarks.BenchmarkDataset.deserializeBinary(fs.readFileSync(filename));
   var messageList = [];
   var messageList = [];
@@ -40,7 +40,7 @@ process.argv.forEach(function(filename, index) {
     messageList.push(message.deserializeBinary(onePayload));
     messageList.push(message.deserializeBinary(onePayload));
     totalBytes += onePayload.length;
     totalBytes += onePayload.length;
   });
   });
-  
+
   var senarios = benchmarkSuite.newBenchmark(
   var senarios = benchmarkSuite.newBenchmark(
       benchmarkDataset.getMessageName(), filename, "js");
       benchmarkDataset.getMessageName(), filename, "js");
   senarios.suite
   senarios.suite
@@ -48,14 +48,14 @@ process.argv.forEach(function(filename, index) {
     benchmarkDataset.getPayloadList().forEach(function(onePayload) {
     benchmarkDataset.getPayloadList().forEach(function(onePayload) {
       var protoType = getNewPrototype(benchmarkDataset.getMessageName());
       var protoType = getNewPrototype(benchmarkDataset.getMessageName());
       protoType.deserializeBinary(onePayload);
       protoType.deserializeBinary(onePayload);
-    });    
+    });
   })
   })
   .add("js serialize", function() {
   .add("js serialize", function() {
     var protoType = getNewPrototype(benchmarkDataset.getMessageName());
     var protoType = getNewPrototype(benchmarkDataset.getMessageName());
     messageList.forEach(function(message) {
     messageList.forEach(function(message) {
       message.serializeBinary();
       message.serializeBinary();
     });
     });
-  }) 
+  })
   .run({"Async": false});
   .run({"Async": false});
 
 
   results.push({
   results.push({
@@ -66,9 +66,9 @@ process.argv.forEach(function(filename, index) {
     }
     }
   })
   })
 
 
-  console.log("Throughput for deserialize: " 
+  console.log("Throughput for deserialize: "
     + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
     + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
-  console.log("Throughput for serialize: " 
+  console.log("Throughput for serialize: "
     + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
     + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
   console.log("");
   console.log("");
 });
 });

+ 7 - 7
benchmarks/php/PhpBenchmark.php

@@ -33,7 +33,7 @@ class BenchmarkMethod
             (new $args[1]())->mergeFromString($payloads->offsetGet($i));
             (new $args[1]())->mergeFromString($payloads->offsetGet($i));
         }
         }
     }
     }
-    
+
     // $args: array of message
     // $args: array of message
     static function serialize(&$args) {
     static function serialize(&$args) {
         foreach ($args as &$temp_message) {
         foreach ($args as &$temp_message) {
@@ -49,7 +49,7 @@ class Benchmark
     private $benchmark_time;
     private $benchmark_time;
     private $total_bytes;
     private $total_bytes;
     private $coefficient;
     private $coefficient;
-    
+
     public function __construct($benchmark_name, $args, $total_bytes,
     public function __construct($benchmark_name, $args, $total_bytes,
         $benchmark_time = 5.0) {
         $benchmark_time = 5.0) {
             $this->args = $args;
             $this->args = $args;
@@ -58,7 +58,7 @@ class Benchmark
             $this->total_bytes = $total_bytes;
             $this->total_bytes = $total_bytes;
             $this->coefficient = pow (10, 0) / pow(2, 20);
             $this->coefficient = pow (10, 0) / pow(2, 20);
     }
     }
-    
+
     public function runBenchmark() {
     public function runBenchmark() {
         $t = $this->runBenchmarkWithTimes(1);
         $t = $this->runBenchmarkWithTimes(1);
         $times = ceil($this->benchmark_time / $t);
         $times = ceil($this->benchmark_time / $t);
@@ -66,7 +66,7 @@ class Benchmark
         ($times == 1 ? $t : $this->runBenchmarkWithTimes($times)) *
         ($times == 1 ? $t : $this->runBenchmarkWithTimes($times)) *
         $this->coefficient;
         $this->coefficient;
     }
     }
-    
+
     private function runBenchmarkWithTimes($times) {
     private function runBenchmarkWithTimes($times) {
         $st = microtime(true);
         $st = microtime(true);
         for ($i = 0; $i < $times; $i++) {
         for ($i = 0; $i < $times; $i++) {
@@ -109,14 +109,14 @@ function runBenchmark($file, $behavior_prefix) {
         array_push($message_list, $new_message);
         array_push($message_list, $new_message);
         $total_bytes += strlen($payloads->offsetGet($i));
         $total_bytes += strlen($payloads->offsetGet($i));
     }
     }
-    
+
     $parse_benchmark = new Benchmark(
     $parse_benchmark = new Benchmark(
         "\Google\Protobuf\Benchmark\BenchmarkMethod::parse",
         "\Google\Protobuf\Benchmark\BenchmarkMethod::parse",
         array($dataset, $message_name), $total_bytes);
         array($dataset, $message_name), $total_bytes);
     $serialize_benchmark = new Benchmark(
     $serialize_benchmark = new Benchmark(
         "\Google\Protobuf\Benchmark\BenchmarkMethod::serialize",
         "\Google\Protobuf\Benchmark\BenchmarkMethod::serialize",
         $message_list, $total_bytes);
         $message_list, $total_bytes);
-    
+
     return array(
     return array(
         "filename" => $file,
         "filename" => $file,
         "benchmarks" => array(
         "benchmarks" => array(
@@ -139,7 +139,7 @@ foreach ($argv as $index => $arg) {
     if ($arg == "--json") {
     if ($arg == "--json") {
         $json_output = true;
         $json_output = true;
     } else if (strpos($arg, "--behavior_prefix") == 0) {
     } else if (strpos($arg, "--behavior_prefix") == 0) {
-        $behavior_prefix = str_replace("--behavior_prefix=", "", $arg);     
+        $behavior_prefix = str_replace("--behavior_prefix=", "", $arg);
     }
     }
 }
 }
 
 

+ 5 - 5
benchmarks/protobuf.js/protobufjs_benchmark.js

@@ -30,7 +30,7 @@ process.argv.forEach(function(filename, index) {
     messageList.push(message.decode(onePayload));
     messageList.push(message.decode(onePayload));
     totalBytes += onePayload.length;
     totalBytes += onePayload.length;
   });
   });
-  
+
   var senarios = benchmarkSuite.newBenchmark(
   var senarios = benchmarkSuite.newBenchmark(
     benchmarkDataset.messageName, filename, "protobufjs");
     benchmarkDataset.messageName, filename, "protobufjs");
   senarios.suite
   senarios.suite
@@ -38,14 +38,14 @@ process.argv.forEach(function(filename, index) {
     benchmarkDataset.payload.forEach(function(onePayload) {
     benchmarkDataset.payload.forEach(function(onePayload) {
       var protoType = getNewPrototype(benchmarkDataset.messageName);
       var protoType = getNewPrototype(benchmarkDataset.messageName);
       protoType.decode(onePayload);
       protoType.decode(onePayload);
-    });    
+    });
   })
   })
   .add("protobuf.js static encoding", function() {
   .add("protobuf.js static encoding", function() {
     var protoType = getNewPrototype(benchmarkDataset.messageName);
     var protoType = getNewPrototype(benchmarkDataset.messageName);
     messageList.forEach(function(message) {
     messageList.forEach(function(message) {
       protoType.encode(message).finish();
       protoType.encode(message).finish();
     });
     });
-  }) 
+  })
   .run({"Async": false});
   .run({"Async": false});
 
 
   results.push({
   results.push({
@@ -56,9 +56,9 @@ process.argv.forEach(function(filename, index) {
     }
     }
   })
   })
 
 
-  console.log("Throughput for decoding: " 
+  console.log("Throughput for decoding: "
     + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
     + senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
-  console.log("Throughput for encoding: " 
+  console.log("Throughput for encoding: "
     + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
     + senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
   console.log("");
   console.log("");
 });
 });

+ 4 - 4
benchmarks/python/py_benchmark.py

@@ -8,7 +8,7 @@ import fnmatch
 import json
 import json
 
 
 parser = argparse.ArgumentParser(description="Python protobuf benchmark")
 parser = argparse.ArgumentParser(description="Python protobuf benchmark")
-parser.add_argument("data_files", metavar="dataFile", nargs="+", 
+parser.add_argument("data_files", metavar="dataFile", nargs="+",
                     help="testing data files.")
                     help="testing data files.")
 parser.add_argument("--json", action="store_const", dest="json",
 parser.add_argument("--json", action="store_const", dest="json",
                     const="yes", default="no",
                     const="yes", default="no",
@@ -138,14 +138,14 @@ class Benchmark:
         t = timeit.timeit(stmt="%s(%s)" % (self.test_method, test_method_args),
         t = timeit.timeit(stmt="%s(%s)" % (self.test_method, test_method_args),
                           setup=self.full_setup_code(setup_method_args),
                           setup=self.full_setup_code(setup_method_args),
                           number=reps);
                           number=reps);
-    return self.total_bytes * 1.0 / 2 ** 20 / (1.0 * t / reps * self.full_iteration)  
-  
+    return self.total_bytes * 1.0 / 2 ** 20 / (1.0 * t / reps * self.full_iteration)
+
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
   results = []
   results = []
   for file in args.data_files:
   for file in args.data_files:
     results.append(run_one_test(file))
     results.append(run_one_test(file))
-  
+
   if args.json != "no":
   if args.json != "no":
     print(json.dumps(results))
     print(json.dumps(results))
   else:
   else:

+ 1 - 1
benchmarks/util/result_parser.py

@@ -295,6 +295,6 @@ def get_result_from_file(cpp_file="",
   if php_file != "":
   if php_file != "":
     __parse_php_result(php_file, "php")
     __parse_php_result(php_file, "php")
   if php_c_file != "":
   if php_c_file != "":
-    __parse_php_result(php_c_file, "php")        
+    __parse_php_result(php_c_file, "php")
 
 
   return __results
   return __results

+ 2 - 2
benchmarks/util/result_uploader.py

@@ -60,7 +60,7 @@ def upload_result(result_list, metadata):
     new_result["labels"] = labels_string[1:]
     new_result["labels"] = labels_string[1:]
     new_result["timestamp"] = _INITIAL_TIME
     new_result["timestamp"] = _INITIAL_TIME
     print(labels_string)
     print(labels_string)
- 
+
     bq = big_query_utils.create_big_query()
     bq = big_query_utils.create_big_query()
     row = big_query_utils.make_row(str(uuid.uuid4()), new_result)
     row = big_query_utils.make_row(str(uuid.uuid4()), new_result)
     if not big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET,
     if not big_query_utils.insert_rows(bq, _PROJECT_ID, _DATASET,
@@ -91,7 +91,7 @@ if __name__ == "__main__":
                       default="")
                       default="")
   parser.add_argument("-php_c", "--php_c_input_file",
   parser.add_argument("-php_c", "--php_c_input_file",
                       help="The php with c ext benchmark result file's name",
                       help="The php with c ext benchmark result file's name",
-                      default="")    
+                      default="")
   args = parser.parse_args()
   args = parser.parse_args()
 
 
   metadata = get_metadata()
   metadata = get_metadata()

+ 7 - 7
cmake/README.md

@@ -130,11 +130,11 @@ It will generate *Visual Studio* solution file *protobuf.sln* in current directo
 If the *gmock* directory does not exist, and you do not want to build protobuf unit tests,
 If the *gmock* directory does not exist, and you do not want to build protobuf unit tests,
 you need to add *cmake* command argument `-Dprotobuf_BUILD_TESTS=OFF` to disable testing.
 you need to add *cmake* command argument `-Dprotobuf_BUILD_TESTS=OFF` to disable testing.
 
 
-To make a *Visual Studio* file for Visual Studio 15 2017, create the *Visual Studio* 
+To make a *Visual Studio* file for Visual Studio 15 2017, create the *Visual Studio*
 solution file above and edit the CmakeCache file.
 solution file above and edit the CmakeCache file.
-	
+
 	C:Path\to\protobuf\cmake\build\solution\CMakeCache
 	C:Path\to\protobuf\cmake\build\solution\CMakeCache
-	
+
 Then create the *Visual Studio* solution file again
 Then create the *Visual Studio* solution file again
 
 
 Compiling
 Compiling
@@ -177,9 +177,9 @@ You should see output similar to:
 
 
      Running main() from gmock_main.cc
      Running main() from gmock_main.cc
      [==========] Running 1546 tests from 165 test cases.
      [==========] Running 1546 tests from 165 test cases.
-     
+
      ...
      ...
-     
+
      [==========] 1546 tests from 165 test cases ran. (2529 ms total)
      [==========] 1546 tests from 165 test cases ran. (2529 ms total)
      [  PASSED  ] 1546 tests.
      [  PASSED  ] 1546 tests.
 
 
@@ -198,7 +198,7 @@ To run specific tests:
      [ RUN      ] AnyTest.TestIs
      [ RUN      ] AnyTest.TestIs
      [       OK ] AnyTest.TestIs (0 ms)
      [       OK ] AnyTest.TestIs (0 ms)
      [----------] 3 tests from AnyTest (1 ms total)
      [----------] 3 tests from AnyTest (1 ms total)
-     
+
      [----------] Global test environment tear-down
      [----------] Global test environment tear-down
      [==========] 3 tests from 1 test case ran. (2 ms total)
      [==========] 3 tests from 1 test case ran. (2 ms total)
      [  PASSED  ] 3 tests.
      [  PASSED  ] 3 tests.
@@ -310,7 +310,7 @@ If you already have ZLIB library and headers at some other location on your syst
 
 
 	-DZLIB_INCLUDE_DIR=<path to dir containing zlib headers>
 	-DZLIB_INCLUDE_DIR=<path to dir containing zlib headers>
 	-DZLIB_LIB=<path to dir containing zlib>
 	-DZLIB_LIB=<path to dir containing zlib>
-	
+
 Build and testing protobuf as usual.
 Build and testing protobuf as usual.
 
 
 Notes on Compiler Warnings
 Notes on Compiler Warnings

+ 1 - 1
cmake/protobuf-config.cmake.in

@@ -37,7 +37,7 @@ function(protobuf_generate)
   if(NOT protobuf_generate_PROTOC_OUT_DIR)
   if(NOT protobuf_generate_PROTOC_OUT_DIR)
     set(protobuf_generate_PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
     set(protobuf_generate_PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
   endif()
   endif()
-  
+
   if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp)
   if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp)
     set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:")
     set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:")
   endif()
   endif()

+ 1 - 1
cmake/version.rc.in

@@ -23,7 +23,7 @@ VS_VERSION_INFO VERSIONINFO
   FILETYPE       VFT_DLL
   FILETYPE       VFT_DLL
 BEGIN
 BEGIN
     BLOCK "VarFileInfo"
     BLOCK "VarFileInfo"
-    BEGIN 
+    BEGIN
         // English language (0x409) and the Windows Unicode codepage (1200)
         // English language (0x409) and the Windows Unicode codepage (1200)
         VALUE "Translation", 0x409, 1200
         VALUE "Translation", 0x409, 1200
     END
     END

+ 6 - 6
conformance/ConformanceJava.java

@@ -57,7 +57,7 @@ class ConformanceJava {
     buf[3] = (byte)(val >> 24);
     buf[3] = (byte)(val >> 24);
     writeToStdout(buf);
     writeToStdout(buf);
   }
   }
-  
+
   private enum BinaryDecoderType {
   private enum BinaryDecoderType {
     BTYE_STRING_DECODER,
     BTYE_STRING_DECODER,
     BYTE_ARRAY_DECODER,
     BYTE_ARRAY_DECODER,
@@ -69,11 +69,11 @@ class ConformanceJava {
   }
   }
 
 
   private static class BinaryDecoder <MessageType extends AbstractMessage> {
   private static class BinaryDecoder <MessageType extends AbstractMessage> {
-    public MessageType decode (ByteString bytes, BinaryDecoderType type, 
+    public MessageType decode (ByteString bytes, BinaryDecoderType type,
         Parser <MessageType> parser, ExtensionRegistry extensions)
         Parser <MessageType> parser, ExtensionRegistry extensions)
       throws InvalidProtocolBufferException {
       throws InvalidProtocolBufferException {
       switch (type) {
       switch (type) {
-        case BTYE_STRING_DECODER: 
+        case BTYE_STRING_DECODER:
           return parser.parseFrom(bytes, extensions);
           return parser.parseFrom(bytes, extensions);
         case BYTE_ARRAY_DECODER:
         case BYTE_ARRAY_DECODER:
           return parser.parseFrom(bytes.toByteArray(), extensions);
           return parser.parseFrom(bytes.toByteArray(), extensions);
@@ -94,7 +94,7 @@ class ConformanceJava {
           } catch (InvalidProtocolBufferException e) {
           } catch (InvalidProtocolBufferException e) {
             throw e;
             throw e;
           }
           }
-        } 
+        }
         case DIRECT_BYTE_BUFFER_DECODER: {
         case DIRECT_BYTE_BUFFER_DECODER: {
           ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size());
           ByteBuffer buffer = ByteBuffer.allocateDirect(bytes.size());
           bytes.copyTo(buffer);
           bytes.copyTo(buffer);
@@ -135,7 +135,7 @@ class ConformanceJava {
     ArrayList <MessageType> messages = new ArrayList <MessageType> ();
     ArrayList <MessageType> messages = new ArrayList <MessageType> ();
     ArrayList <InvalidProtocolBufferException> exceptions =
     ArrayList <InvalidProtocolBufferException> exceptions =
         new ArrayList <InvalidProtocolBufferException>();
         new ArrayList <InvalidProtocolBufferException>();
-    
+
     for (int i = 0; i < BinaryDecoderType.values().length; i++) {
     for (int i = 0; i < BinaryDecoderType.values().length; i++) {
       messages.add(null);
       messages.add(null);
       exceptions.add(null);
       exceptions.add(null);
@@ -290,7 +290,7 @@ class ConformanceJava {
         throw new RuntimeException("Unspecified output format.");
         throw new RuntimeException("Unspecified output format.");
 
 
       case PROTOBUF: {
       case PROTOBUF: {
-        ByteString MessageString = testMessage.toByteString(); 
+        ByteString MessageString = testMessage.toByteString();
         return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(MessageString).build();
         return Conformance.ConformanceResponse.newBuilder().setProtobufPayload(MessageString).build();
       }
       }
 
 

+ 1 - 1
conformance/conformance_ruby.rb

@@ -54,7 +54,7 @@ def do_test(request)
       elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2')
       elsif request.message_type.eql?('protobuf_test_messages.proto2.TestAllTypesProto2')
         response.skipped = "Ruby doesn't support proto2"
         response.skipped = "Ruby doesn't support proto2"
         return response
         return response
-      else 
+      else
         fail "Protobuf request doesn't have specific payload type"
         fail "Protobuf request doesn't have specific payload type"
       end
       end
 
 

+ 10 - 10
conformance/third_party/jsoncpp/json.h

@@ -6,28 +6,28 @@
 // //////////////////////////////////////////////////////////////////////
 // //////////////////////////////////////////////////////////////////////
 
 
 /*
 /*
-The JsonCpp library's source code, including accompanying documentation, 
+The JsonCpp library's source code, including accompanying documentation,
 tests and demonstration applications, are licensed under the following
 tests and demonstration applications, are licensed under the following
 conditions...
 conditions...
 
 
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all 
-jurisdictions which recognize such a disclaimer. In such jurisdictions, 
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
 this software is released into the Public Domain.
 this software is released into the Public Domain.
 
 
 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
 released under the terms of the MIT License (see below).
 released under the terms of the MIT License (see below).
 
 
-In jurisdictions which recognize Public Domain property, the user of this 
-software may choose to accept it either as 1) Public Domain, 2) under the 
-conditions of the MIT License (see below), or 3) under the terms of dual 
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
 Public Domain/MIT License conditions described here, as they choose.
 Public Domain/MIT License conditions described here, as they choose.
 
 
 The MIT License is about as close to Public Domain as a license can get, and is
 The MIT License is about as close to Public Domain as a license can get, and is
 described in clear, concise terms at:
 described in clear, concise terms at:
 
 
    http://en.wikipedia.org/wiki/MIT_License
    http://en.wikipedia.org/wiki/MIT_License
-   
+
 The full text of the MIT License follows:
 The full text of the MIT License follows:
 
 
 ========================================================================
 ========================================================================
@@ -434,7 +434,7 @@ protected:
 /** Exceptions which the user cannot easily avoid.
 /** Exceptions which the user cannot easily avoid.
  *
  *
  * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
  * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
- * 
+ *
  * \remark derived from Json::Exception
  * \remark derived from Json::Exception
  */
  */
 class JSON_API RuntimeError : public Exception {
 class JSON_API RuntimeError : public Exception {
@@ -445,7 +445,7 @@ public:
 /** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
 /** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
  *
  *
  * These are precondition-violations (user bugs) and internal errors (our bugs).
  * These are precondition-violations (user bugs) and internal errors (our bugs).
- * 
+ *
  * \remark derived from Json::Exception
  * \remark derived from Json::Exception
  */
  */
 class JSON_API LogicError : public Exception {
 class JSON_API LogicError : public Exception {
@@ -1570,7 +1570,7 @@ public:
     - `"rejectDupKeys": false or true`
     - `"rejectDupKeys": false or true`
       - If true, `parse()` returns false when a key is duplicated within an object.
       - If true, `parse()` returns false when a key is duplicated within an object.
     - `"allowSpecialFloats": false or true`
     - `"allowSpecialFloats": false or true`
-      - If true, special float values (NaNs and infinities) are allowed 
+      - If true, special float values (NaNs and infinities) are allowed
         and their values are lossfree restorable.
         and their values are lossfree restorable.
 
 
     You can examine 'settings_` yourself
     You can examine 'settings_` yourself

+ 10 - 10
conformance/third_party/jsoncpp/jsoncpp.cpp

@@ -6,28 +6,28 @@
 // //////////////////////////////////////////////////////////////////////
 // //////////////////////////////////////////////////////////////////////
 
 
 /*
 /*
-The JsonCpp library's source code, including accompanying documentation, 
+The JsonCpp library's source code, including accompanying documentation,
 tests and demonstration applications, are licensed under the following
 tests and demonstration applications, are licensed under the following
 conditions...
 conditions...
 
 
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all 
-jurisdictions which recognize such a disclaimer. In such jurisdictions, 
+The author (Baptiste Lepilleur) explicitly disclaims copyright in all
+jurisdictions which recognize such a disclaimer. In such jurisdictions,
 this software is released into the Public Domain.
 this software is released into the Public Domain.
 
 
 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
 released under the terms of the MIT License (see below).
 released under the terms of the MIT License (see below).
 
 
-In jurisdictions which recognize Public Domain property, the user of this 
-software may choose to accept it either as 1) Public Domain, 2) under the 
-conditions of the MIT License (see below), or 3) under the terms of dual 
+In jurisdictions which recognize Public Domain property, the user of this
+software may choose to accept it either as 1) Public Domain, 2) under the
+conditions of the MIT License (see below), or 3) under the terms of dual
 Public Domain/MIT License conditions described here, as they choose.
 Public Domain/MIT License conditions described here, as they choose.
 
 
 The MIT License is about as close to Public Domain as a license can get, and is
 The MIT License is about as close to Public Domain as a license can get, and is
 described in clear, concise terms at:
 described in clear, concise terms at:
 
 
    http://en.wikipedia.org/wiki/MIT_License
    http://en.wikipedia.org/wiki/MIT_License
-   
+
 The full text of the MIT License follows:
 The full text of the MIT License follows:
 
 
 ========================================================================
 ========================================================================
@@ -207,7 +207,7 @@ static inline void fixNumericLocale(char* begin, char* end) {
 #include <limits>
 #include <limits>
 
 
 #if defined(_MSC_VER)
 #if defined(_MSC_VER)
-#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above 
+#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
 #define snprintf sprintf_s
 #define snprintf sprintf_s
 #elif _MSC_VER >= 1900 // VC++ 14.0 and above
 #elif _MSC_VER >= 1900 // VC++ 14.0 and above
 #define snprintf std::snprintf
 #define snprintf std::snprintf
@@ -4029,7 +4029,7 @@ Value& Path::make(Value& root) const {
 #define snprintf std::snprintf
 #define snprintf std::snprintf
 #endif
 #endif
 
 
-#if defined(__BORLANDC__)  
+#if defined(__BORLANDC__)
 #include <float.h>
 #include <float.h>
 #define isfinite _finite
 #define isfinite _finite
 #define snprintf _snprintf
 #define snprintf _snprintf
@@ -5096,7 +5096,7 @@ StreamWriter* StreamWriterBuilder::newStreamWriter() const
   std::string cs_str = settings_["commentStyle"].asString();
   std::string cs_str = settings_["commentStyle"].asString();
   bool eyc = settings_["enableYAMLCompatibility"].asBool();
   bool eyc = settings_["enableYAMLCompatibility"].asBool();
   bool dnp = settings_["dropNullPlaceholders"].asBool();
   bool dnp = settings_["dropNullPlaceholders"].asBool();
-  bool usf = settings_["useSpecialFloats"].asBool(); 
+  bool usf = settings_["useSpecialFloats"].asBool();
   unsigned int pre = settings_["precision"].asUInt();
   unsigned int pre = settings_["precision"].asUInt();
   CommentStyle::Enum cs = CommentStyle::All;
   CommentStyle::Enum cs = CommentStyle::All;
   if (cs_str == "All") {
   if (cs_str == "All") {

+ 9 - 9
csharp/CHANGES.txt

@@ -26,7 +26,7 @@ Changes:
 - Optimized enum parsing.
 - Optimized enum parsing.
 
 
 Fixes:
 Fixes:
-- Fix for bug in limited input stream's Position, Introduced Position on 
+- Fix for bug in limited input stream's Position, Introduced Position on
   output stream
   output stream
 - Fix for writing a character to a JSON output overflows allocated buffer
 - Fix for writing a character to a JSON output overflows allocated buffer
 - Optimize FromBase64String to return Empty when presented with empty string.
 - Optimize FromBase64String to return Empty when presented with empty string.
@@ -47,14 +47,14 @@ Changes:
 - Added 'Unsafe' static type in ByteString to allow direct buffer access
 - Added 'Unsafe' static type in ByteString to allow direct buffer access
 
 
 Fixes:
 Fixes:
-- Issue 50: The XML serializer will fail to deserialize a message with empty 
+- Issue 50: The XML serializer will fail to deserialize a message with empty
   child message
   child message
 - Issue 45: Use of 'item' as a field name causes AmbiguousMatchException
 - Issue 45: Use of 'item' as a field name causes AmbiguousMatchException
 - Issue 49: Generated nested static Types class should be partial
 - Issue 49: Generated nested static Types class should be partial
 - Issue 38: Disable CLSCompliant warnings (3021)
 - Issue 38: Disable CLSCompliant warnings (3021)
 - Issue 40: proto_path does not work for command-line file names
 - Issue 40: proto_path does not work for command-line file names
 - Issue 54: should retire all bytes in buffer (bufferSize)
 - Issue 54: should retire all bytes in buffer (bufferSize)
-- Issue 43: Fix to correct identical 'umbrella_classname' options from trying 
+- Issue 43: Fix to correct identical 'umbrella_classname' options from trying
   to write to the same filename.
   to write to the same filename.
 
 
 ===============================================================================
 ===============================================================================
@@ -66,7 +66,7 @@ Features:
   NONE, GENERIC, INTERFACE, or IRPCDISPATCH
   NONE, GENERIC, INTERFACE, or IRPCDISPATCH
 - Added interfaces IRpcDispatch and IRpcServerStub to provide for blocking
 - Added interfaces IRpcDispatch and IRpcServerStub to provide for blocking
   services and implementations.
   services and implementations.
-- Added ProtoGen.exe command-line argument "--protoc_dir=" to specify the 
+- Added ProtoGen.exe command-line argument "--protoc_dir=" to specify the
   location of protoc.exe.
   location of protoc.exe.
 - Extracted interfaces for ICodedInputStream and ICodedOutputStream to allow
 - Extracted interfaces for ICodedInputStream and ICodedOutputStream to allow
   custom implementation of writers with both speed and size optimizations.
   custom implementation of writers with both speed and size optimizations.
@@ -86,9 +86,9 @@ Fixes:
 - Issue 16:	Does not integrate well with other tooling
 - Issue 16:	Does not integrate well with other tooling
 - Issue 19:	Support for negative enum values
 - Issue 19:	Support for negative enum values
 - Issue 26:	AddRange in GeneratedBuilder iterates twice.
 - Issue 26:	AddRange in GeneratedBuilder iterates twice.
-- Issue 27:	Remove XML documentation output from test projects to clear 
+- Issue 27:	Remove XML documentation output from test projects to clear
   warnings/errors.
   warnings/errors.
-- Issue 28: Circular message dependencies result in null default values for 
+- Issue 28: Circular message dependencies result in null default values for
   Message fields.
   Message fields.
 - Issue 29: Message classes generated have a public default constructor.  You
 - Issue 29: Message classes generated have a public default constructor.  You
   can disable private ctor generation with the option generate_private_ctor.
   can disable private ctor generation with the option generate_private_ctor.
@@ -109,14 +109,14 @@ RELEASE NOTES - Version 2.3.0.277
 ===============================================================================
 ===============================================================================
 
 
 Features:
 Features:
-- Added cls_compliance option to generate attributes indicating 
+- Added cls_compliance option to generate attributes indicating
   non-CLS-compliance.
   non-CLS-compliance.
 - Added file_extension option to control the generated output file's extension.
 - Added file_extension option to control the generated output file's extension.
 - Added umbrella_namespace option to place the umbrella class into a nested
 - Added umbrella_namespace option to place the umbrella class into a nested
-  namespace to address issues with proto files having the same name as a 
+  namespace to address issues with proto files having the same name as a
   message it contains.
   message it contains.
 - Added output_directory option to set the output path for the source file(s).
 - Added output_directory option to set the output path for the source file(s).
-- Added ignore_google_protobuf option to avoid generating code for includes 
+- Added ignore_google_protobuf option to avoid generating code for includes
   from the google.protobuf package.
   from the google.protobuf package.
 - Added the LITE framework (Google.ProtoBuffersLite.dll) and the ability to
 - Added the LITE framework (Google.ProtoBuffersLite.dll) and the ability to
   generate code with "option optimize_for = LITE_RUNTIME;".
   generate code with "option optimize_for = LITE_RUNTIME;".

+ 13 - 13
csharp/README.md

@@ -10,7 +10,7 @@ You will also want to install the `Google.Protobuf.Tools` NuGet package, which
 contains precompiled version of `protoc.exe` and a copy of well known `.proto`
 contains precompiled version of `protoc.exe` and a copy of well known `.proto`
 files under the package's `tools` directory.
 files under the package's `tools` directory.
 
 
-To generate C# files from your `.proto` files, invoke `protoc` with the 
+To generate C# files from your `.proto` files, invoke `protoc` with the
 `--csharp_out` option.
 `--csharp_out` option.
 
 
 Supported platforms
 Supported platforms
@@ -37,8 +37,8 @@ later.
 Although *users* of this project are only expected to have Visual
 Although *users* of this project are only expected to have Visual
 Studio 2012 or later, *developers* of the library are required to
 Studio 2012 or later, *developers* of the library are required to
 have Visual Studio 2017 or later, as the library uses C# 6 features
 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 - 
+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.
 they're only relevant when building the `Google.Protobuf` assembly.
 
 
 In order to run and debug the AddressBook example in the IDE, you must
 In order to run and debug the AddressBook example in the IDE, you must
@@ -56,19 +56,19 @@ run using the Visual Studio Test Explorer or `dotnet test`.
 .NET 3.5
 .NET 3.5
 ========
 ========
 
 
-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 
+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.
 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): 
+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 
+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).
 `PropertyGroup` element, i.e., the one with the conditional).
 
 
 History of C# protobufs
 History of C# protobufs

+ 5 - 5
csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto

@@ -20,7 +20,7 @@ message Issue307 {
 
 
 // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
 // 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
 // New issue 309: https://github.com/protocolbuffers/protobuf/issues/309
- 
+
 // message A {
 // message A {
 //    optional int32 _A = 1;
 //    optional int32 _A = 1;
 // }
 // }
@@ -101,21 +101,21 @@ message TestJsonFieldOrdering {
   // that will require fixing other tests in multiple platforms.
   // that will require fixing other tests in multiple platforms.
   // Alternatively, consider just adding this to
   // Alternatively, consider just adding this to
   // unittest_proto3.proto if multiple platforms want it.
   // unittest_proto3.proto if multiple platforms want it.
-  
+
   int32 plain_int32 = 4;
   int32 plain_int32 = 4;
 
 
   oneof o1 {
   oneof o1 {
     string o1_string = 2;
     string o1_string = 2;
     int32 o1_int32 = 5;
     int32 o1_int32 = 5;
   }
   }
-  
+
   string plain_string = 1;
   string plain_string = 1;
-  
+
   oneof o2 {
   oneof o2 {
     int32 o2_int32 = 6;
     int32 o2_int32 = 6;
     string o2_string = 3;
     string o2_string = 3;
   }
   }
-  
+
 }
 }
 
 
 message TestJsonName {
 message TestJsonName {

+ 2 - 2
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Collections/MapFieldTest.cs

@@ -86,7 +86,7 @@ namespace Google.Protobuf.Collections
             var map = new MapField<string, ForeignMessage>();
             var map = new MapField<string, ForeignMessage>();
             Assert.Throws<ArgumentNullException>(() => map[null] = new ForeignMessage());
             Assert.Throws<ArgumentNullException>(() => map[null] = new ForeignMessage());
         }
         }
-        
+
         [Test]
         [Test]
         public void AddPreservesInsertionOrder()
         public void AddPreservesInsertionOrder()
         {
         {
@@ -471,7 +471,7 @@ namespace Google.Protobuf.Collections
             keys.CopyTo(array, 1);
             keys.CopyTo(array, 1);
             CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array);
             CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array);
         }
         }
-        
+
         // Just test keys - we know the implementation is the same for values
         // Just test keys - we know the implementation is the same for values
         [Test]
         [Test]
         public void NonGenericViewCopyTo()
         public void NonGenericViewCopyTo()

+ 1 - 1
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs

@@ -59,7 +59,7 @@ namespace Google.Protobuf.Compatibility
         [TestCase(typeof(string), typeof(int), false)]
         [TestCase(typeof(string), typeof(int), false)]
         [TestCase(typeof(int), typeof(int), true)]
         [TestCase(typeof(int), typeof(int), true)]
         [TestCase(typeof(ValueType), typeof(int), true)]
         [TestCase(typeof(ValueType), typeof(int), true)]
-        [TestCase(typeof(long), typeof(int), false)] // 
+        [TestCase(typeof(long), typeof(int), false)] //
         public void IsAssignableFrom(Type target, Type argument, bool expected)
         public void IsAssignableFrom(Type target, Type argument, bool expected)
         {
         {
             Assert.AreEqual(expected, TypeExtensions.IsAssignableFrom(target, argument));
             Assert.AreEqual(expected, TypeExtensions.IsAssignableFrom(target, argument));

+ 2 - 2
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj

@@ -18,7 +18,7 @@
     <PackageReference Include="NUnitLite" Version="3.6.1" />
     <PackageReference Include="NUnitLite" Version="3.6.1" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <!-- 
+  <!--
     - Override target frameworks on non-Windows to just .NET Core
     - Override target frameworks on non-Windows to just .NET Core
     - Doing this conditionally in the initial PropertyGroup confuses
     - Doing this conditionally in the initial PropertyGroup confuses
     - Visual Studio.
     - Visual Studio.
@@ -26,5 +26,5 @@
   <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
   <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
     <TargetFrameworks>netcoreapp1.0</TargetFrameworks>
     <TargetFrameworks>netcoreapp1.0</TargetFrameworks>
   </PropertyGroup>
   </PropertyGroup>
-  
+
 </Project>
 </Project>

+ 5 - 5
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/JsonTokenizerTest.cs

@@ -240,7 +240,7 @@ namespace Google.Protobuf
             AssertTokens("{'x': 'y'}",
             AssertTokens("{'x': 'y'}",
                 JsonToken.StartObject, JsonToken.Name("x"), JsonToken.Value("y"), JsonToken.EndObject);
                 JsonToken.StartObject, JsonToken.Name("x"), JsonToken.Value("y"), JsonToken.EndObject);
         }
         }
-        
+
         [Test]
         [Test]
         [TestCase("[10, 20", 3)]
         [TestCase("[10, 20", 3)]
         [TestCase("[10,", 2)]
         [TestCase("[10,", 2)]
@@ -305,7 +305,7 @@ namespace Google.Protobuf
         [Test]
         [Test]
         public void ObjectMixedType()
         public void ObjectMixedType()
         {
         {
-            AssertTokens(@"{'a': 1, 'b': 'bar', 'c': null, 'd': false, 'e': true, 
+            AssertTokens(@"{'a': 1, 'b': 'bar', 'c': null, 'd': false, 'e': true,
                            'f': [2], 'g': {'x':'y' }}",
                            'f': [2], 'g': {'x':'y' }}",
                 JsonToken.StartObject,
                 JsonToken.StartObject,
                 JsonToken.Name("a"),
                 JsonToken.Name("a"),
@@ -349,12 +349,12 @@ namespace Google.Protobuf
             Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next());
             Assert.AreEqual(JsonToken.EndDocument, tokenizer.Next());
             Assert.Throws<InvalidOperationException>(() => tokenizer.Next());
             Assert.Throws<InvalidOperationException>(() => tokenizer.Next());
         }
         }
-       
+
         /// <summary>
         /// <summary>
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// All apostrophes are first converted to double quotes, allowing any tests
         /// 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
         /// 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 
+        /// messy string literal escaping. The "end document" token is not specified in the list of
         /// expected tokens, but is implicit.
         /// expected tokens, but is implicit.
         /// </summary>
         /// </summary>
         private static void AssertTokens(string json, params JsonToken[] expectedTokens)
         private static void AssertTokens(string json, params JsonToken[] expectedTokens)
@@ -366,7 +366,7 @@ namespace Google.Protobuf
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Unlike <see cref="AssertTokens(string, JsonToken[])"/>, this does not perform any character
         /// Unlike <see cref="AssertTokens(string, JsonToken[])"/>, this does not perform any character
         /// replacement on the specified JSON, and should be used when the text contains apostrophes which
         /// 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 
+        /// are expected to be used *as* apostrophes. The "end document" token is not specified in the list of
         /// expected tokens, but is implicit.
         /// expected tokens, but is implicit.
         /// </summary>
         /// </summary>
         private static void AssertTokensNoReplacement(string json, params JsonToken[] expectedTokens)
         private static void AssertTokensNoReplacement(string json, params JsonToken[] expectedTokens)

+ 2 - 2
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs

@@ -150,7 +150,7 @@ namespace Google.Protobuf.Reflection
             Assert.AreEqual(UnittestProto3Reflection.Descriptor, primitiveField.File);
             Assert.AreEqual(UnittestProto3Reflection.Descriptor, primitiveField.File);
             Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
             Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
             Assert.IsNull(primitiveField.Proto.Options);
             Assert.IsNull(primitiveField.Proto.Options);
-            
+
             Assert.AreEqual("single_nested_enum", enumField.Name);
             Assert.AreEqual("single_nested_enum", enumField.Name);
             Assert.AreEqual(FieldType.Enum, enumField.FieldType);
             Assert.AreEqual(FieldType.Enum, enumField.FieldType);
             // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType);
             // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType);
@@ -242,7 +242,7 @@ namespace Google.Protobuf.Reflection
         // NestedMessage single_nested_message = 200;
         // NestedMessage single_nested_message = 200;
         [Test]
         [Test]
         public void FieldListOrderings()
         public void FieldListOrderings()
-        { 
+        {
             var fields = TestFieldOrderings.Descriptor.Fields;
             var fields = TestFieldOrderings.Descriptor.Fields;
             Assert.AreEqual(new[] { 11, 1, 101, 200 }, fields.InDeclarationOrder().Select(x => x.FieldNumber));
             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));
             Assert.AreEqual(new[] { 1, 11, 101, 200 }, fields.InFieldNumberOrder().Select(x => x.FieldNumber));

+ 1 - 1
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs

@@ -213,6 +213,6 @@ namespace Google.Protobuf.Reflection
             var descriptor = TestAllTypes.Descriptor;
             var descriptor = TestAllTypes.Descriptor;
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields[999999].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields[999999].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields["not found"].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields["not found"].ToString());
-        }        
+        }
     }
     }
 }
 }

+ 1 - 1
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/SampleEnum.cs

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endregion
 #endregion
-    
+
 namespace Google.Protobuf
 namespace Google.Protobuf
 {
 {
     // Just a sample enum with positive and negative values to be used in tests.
     // Just a sample enum with positive and negative values to be used in tests.

+ 1 - 1
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs

@@ -99,7 +99,7 @@ namespace Google.Protobuf.WellKnownTypes
             Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 };
             Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 };
             Assert.AreEqual(difference, t1 - t2);
             Assert.AreEqual(difference, t1 - t2);
             Assert.AreEqual(-difference, t2 - t1);
             Assert.AreEqual(-difference, t2 - t1);
-            
+
             Assert.AreEqual(t1, t2 + difference);
             Assert.AreEqual(t1, t2 + difference);
             Assert.AreEqual(t2, t1 - difference);
             Assert.AreEqual(t2, t1 - difference);
         }
         }

+ 2 - 2
csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs

@@ -135,7 +135,7 @@ namespace Google.Protobuf.WellKnownTypes
                 DoubleField = { 12.5, -1.5, 0d },
                 DoubleField = { 12.5, -1.5, 0d },
                 FloatField = { 123.25f, -20f, 0f },
                 FloatField = { 123.25f, -20f, 0f },
                 Int32Field = { int.MaxValue, int.MinValue, 0 },
                 Int32Field = { int.MaxValue, int.MinValue, 0 },
-                Int64Field = { long.MaxValue, long.MinValue, 0L },                
+                Int64Field = { long.MaxValue, long.MinValue, 0L },
                 StringField = { "First", "Second", "" },
                 StringField = { "First", "Second", "" },
                 Uint32Field = { uint.MaxValue, uint.MinValue, 0U },
                 Uint32Field = { uint.MaxValue, uint.MinValue, 0U },
                 Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL },
                 Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL },
@@ -403,7 +403,7 @@ namespace Google.Protobuf.WellKnownTypes
 
 
             output.Flush();
             output.Flush();
             stream.Position = 0;
             stream.Position = 0;
-            
+
             var message = TestWellKnownTypes.Parser.ParseFrom(stream);
             var message = TestWellKnownTypes.Parser.ParseFrom(stream);
             Assert.AreEqual(6, message.Int32Field);
             Assert.AreEqual(6, message.Int32Field);
         }
         }

+ 5 - 5
csharp/protos/unittest_issues.proto

@@ -19,7 +19,7 @@ message Issue307 {
 
 
 // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13
 // 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
 // New issue 309: https://github.com/protocolbuffers/protobuf/issues/309
- 
+
 // message A {
 // message A {
 //    optional int32 _A = 1;
 //    optional int32 _A = 1;
 // }
 // }
@@ -100,21 +100,21 @@ message TestJsonFieldOrdering {
   // that will require fixing other tests in multiple platforms.
   // that will require fixing other tests in multiple platforms.
   // Alternatively, consider just adding this to
   // Alternatively, consider just adding this to
   // unittest_proto3.proto if multiple platforms want it.
   // unittest_proto3.proto if multiple platforms want it.
-  
+
   int32 plain_int32 = 4;
   int32 plain_int32 = 4;
 
 
   oneof o1 {
   oneof o1 {
     string o1_string = 2;
     string o1_string = 2;
     int32 o1_int32 = 5;
     int32 o1_int32 = 5;
   }
   }
-  
+
   string plain_string = 1;
   string plain_string = 1;
-  
+
   oneof o2 {
   oneof o2 {
     int32 o2_int32 = 6;
     int32 o2_int32 = 6;
     string o2_string = 3;
     string o2_string = 3;
   }
   }
-  
+
 }
 }
 
 
 message TestJsonName {
 message TestJsonName {

+ 2 - 2
csharp/protos/unittest_proto3.proto

@@ -392,13 +392,13 @@ message CommentMessage {
     // Leading nested message field comment
     // Leading nested message field comment
     string nested_text = 1;
     string nested_text = 1;
   }
   }
-  
+
   // Leading nested enum comment
   // Leading nested enum comment
   enum NestedCommentEnum {
   enum NestedCommentEnum {
     // Zero value comment
     // Zero value comment
     ZERO_VALUE = 0;
     ZERO_VALUE = 0;
   }
   }
-  
+
   // Leading field comment
   // Leading field comment
   string text = 1; // Trailing field comment
   string text = 1; // Trailing field comment
 }
 }

+ 3 - 9
csharp/src/AddressBook/Addressbook.cs

@@ -260,9 +260,7 @@ namespace Google.Protobuf.Examples.AddressBook {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -442,9 +440,7 @@ namespace Google.Protobuf.Examples.AddressBook {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 10: {
               case 10: {
                 Number = input.ReadString();
                 Number = input.ReadString();
@@ -577,9 +573,7 @@ namespace Google.Protobuf.Examples.AddressBook {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             people_.AddEntriesFrom(input, _repeated_people_codec);
             people_.AddEntriesFrom(input, _repeated_people_codec);

+ 4 - 12
csharp/src/Google.Protobuf.Conformance/Conformance.cs

@@ -216,9 +216,7 @@ namespace Conformance {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             failure_.AddEntriesFrom(input, _repeated_failure_codec);
             failure_.AddEntriesFrom(input, _repeated_failure_codec);
@@ -581,9 +579,7 @@ namespace Conformance {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             ProtobufPayload = input.ReadBytes();
             ProtobufPayload = input.ReadBytes();
@@ -1001,9 +997,7 @@ namespace Conformance {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             ParseError = input.ReadString();
             ParseError = input.ReadString();
@@ -1166,9 +1160,7 @@ namespace Conformance {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             UseJspbArrayAnyFormat = input.ReadBool();
             UseJspbArrayAnyFormat = input.ReadBool();

+ 4 - 4
csharp/src/Google.Protobuf.Conformance/Program.cs

@@ -93,17 +93,17 @@ namespace Google.Protobuf.Conformance
                         var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry));
                         var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry));
                         message = parser.Parse<ProtobufTestMessages.Proto3.TestAllTypesProto3>(request.JsonPayload);
                         message = parser.Parse<ProtobufTestMessages.Proto3.TestAllTypesProto3>(request.JsonPayload);
                         break;
                         break;
-                    case ConformanceRequest.PayloadOneofCase.ProtobufPayload: 
+                    case ConformanceRequest.PayloadOneofCase.ProtobufPayload:
                     {
                     {
                         if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3"))
                         if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3"))
                         {
                         {
                             message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload);
                             message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload);
-                        }							
-                        else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) 
+                        }
+                        else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2"))
                         {
                         {
                             return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" };
                             return new ConformanceResponse { Skipped = "CSharp doesn't support proto2" };
                         }
                         }
-                        else 
+                        else
                         {
                         {
                             throw new Exception(" Protobuf request doesn't have specific payload type");
                             throw new Exception(" Protobuf request doesn't have specific payload type");
                         }
                         }

+ 2 - 2
csharp/src/Google.Protobuf.Test/Collections/MapFieldTest.cs

@@ -86,7 +86,7 @@ namespace Google.Protobuf.Collections
             var map = new MapField<string, ForeignMessage>();
             var map = new MapField<string, ForeignMessage>();
             Assert.Throws<ArgumentNullException>(() => map[null] = new ForeignMessage());
             Assert.Throws<ArgumentNullException>(() => map[null] = new ForeignMessage());
         }
         }
-        
+
         [Test]
         [Test]
         public void AddPreservesInsertionOrder()
         public void AddPreservesInsertionOrder()
         {
         {
@@ -471,7 +471,7 @@ namespace Google.Protobuf.Collections
             keys.CopyTo(array, 1);
             keys.CopyTo(array, 1);
             CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array);
             CollectionAssert.AreEqual(new[] { null, "foo", "x", null }, array);
         }
         }
-        
+
         // Just test keys - we know the implementation is the same for values
         // Just test keys - we know the implementation is the same for values
         [Test]
         [Test]
         public void NonGenericViewCopyTo()
         public void NonGenericViewCopyTo()

+ 1 - 1
csharp/src/Google.Protobuf.Test/Collections/ProtobufEqualityComparersTest.cs

@@ -120,5 +120,5 @@ namespace Google.Protobuf.Collections
                 }
                 }
             }
             }
         }
         }
-    }    
+    }
 }
 }

+ 1 - 1
csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs

@@ -59,7 +59,7 @@ namespace Google.Protobuf.Compatibility
         [TestCase(typeof(string), typeof(int), false)]
         [TestCase(typeof(string), typeof(int), false)]
         [TestCase(typeof(int), typeof(int), true)]
         [TestCase(typeof(int), typeof(int), true)]
         [TestCase(typeof(ValueType), typeof(int), true)]
         [TestCase(typeof(ValueType), typeof(int), true)]
-        [TestCase(typeof(long), typeof(int), false)] // 
+        [TestCase(typeof(long), typeof(int), false)] //
         public void IsAssignableFrom(Type target, Type argument, bool expected)
         public void IsAssignableFrom(Type target, Type argument, bool expected)
         {
         {
             Assert.AreEqual(expected, TypeExtensions.IsAssignableFrom(target, argument));
             Assert.AreEqual(expected, TypeExtensions.IsAssignableFrom(target, argument));

+ 2 - 2
csharp/src/Google.Protobuf.Test/FieldMaskTreeTest.cs

@@ -68,7 +68,7 @@ namespace Google.Protobuf
             paths = tree.ToFieldMask().Paths;
             paths = tree.ToFieldMask().Paths;
             Assert.AreEqual(3, paths.Count);
             Assert.AreEqual(3, paths.Count);
             Assert.Contains("bar.baz", paths);
             Assert.Contains("bar.baz", paths);
-            
+
             // Redundant sub-path.
             // Redundant sub-path.
             tree.AddFieldPath("foo.bar");
             tree.AddFieldPath("foo.bar");
             paths = tree.ToFieldMask().Paths;
             paths = tree.ToFieldMask().Paths;
@@ -79,7 +79,7 @@ namespace Google.Protobuf
             paths = tree.ToFieldMask().Paths;
             paths = tree.ToFieldMask().Paths;
             Assert.AreEqual(4, paths.Count);
             Assert.AreEqual(4, paths.Count);
             Assert.Contains("bar.quz", paths);
             Assert.Contains("bar.quz", paths);
-            
+
             // A path that matches several existing sub-paths.
             // A path that matches several existing sub-paths.
             tree.AddFieldPath("bar");
             tree.AddFieldPath("bar");
             paths = tree.ToFieldMask().Paths;
             paths = tree.ToFieldMask().Paths;

+ 1 - 1
csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj

@@ -18,7 +18,7 @@
     <PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
     <PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <!-- 
+  <!--
     - Override target frameworks on non-Windows to just .NET Core
     - Override target frameworks on non-Windows to just .NET Core
     - Doing this conditionally in the initial PropertyGroup confuses
     - Doing this conditionally in the initial PropertyGroup confuses
     - Visual Studio.
     - Visual Studio.

+ 1 - 1
csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs

@@ -243,7 +243,7 @@ namespace Google.Protobuf
         [Test]
         [Test]
         public void InvalidSurrogatePairsFail()
         public void InvalidSurrogatePairsFail()
         {
         {
-            // Note: don't use TestCase for these, as the strings can't be reliably represented 
+            // Note: don't use TestCase for these, as the strings can't be reliably represented
             // See http://codeblog.jonskeet.uk/2014/11/07/when-is-a-string-not-a-string/
             // See http://codeblog.jonskeet.uk/2014/11/07/when-is-a-string-not-a-string/
 
 
             // Lone low surrogate
             // Lone low surrogate

+ 5 - 5
csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs

@@ -240,7 +240,7 @@ namespace Google.Protobuf
             AssertTokens("{'x': 'y'}",
             AssertTokens("{'x': 'y'}",
                 JsonToken.StartObject, JsonToken.Name("x"), JsonToken.Value("y"), JsonToken.EndObject);
                 JsonToken.StartObject, JsonToken.Name("x"), JsonToken.Value("y"), JsonToken.EndObject);
         }
         }
-        
+
         [Test]
         [Test]
         [TestCase("[10, 20", 3)]
         [TestCase("[10, 20", 3)]
         [TestCase("[10,", 2)]
         [TestCase("[10,", 2)]
@@ -305,7 +305,7 @@ namespace Google.Protobuf
         [Test]
         [Test]
         public void ObjectMixedType()
         public void ObjectMixedType()
         {
         {
-            AssertTokens(@"{'a': 1, 'b': 'bar', 'c': null, 'd': false, 'e': true, 
+            AssertTokens(@"{'a': 1, 'b': 'bar', 'c': null, 'd': false, 'e': true,
                            'f': [2], 'g': {'x':'y' }}",
                            'f': [2], 'g': {'x':'y' }}",
                 JsonToken.StartObject,
                 JsonToken.StartObject,
                 JsonToken.Name("a"),
                 JsonToken.Name("a"),
@@ -365,12 +365,12 @@ namespace Google.Protobuf
             tokenizer.SkipValue();
             tokenizer.SkipValue();
             Assert.AreEqual("next", tokenizer.Next().StringValue);
             Assert.AreEqual("next", tokenizer.Next().StringValue);
         }
         }
-       
+
         /// <summary>
         /// <summary>
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// All apostrophes are first converted to double quotes, allowing any tests
         /// 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
         /// 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 
+        /// messy string literal escaping. The "end document" token is not specified in the list of
         /// expected tokens, but is implicit.
         /// expected tokens, but is implicit.
         /// </summary>
         /// </summary>
         private static void AssertTokens(string json, params JsonToken[] expectedTokens)
         private static void AssertTokens(string json, params JsonToken[] expectedTokens)
@@ -382,7 +382,7 @@ namespace Google.Protobuf
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Asserts that the specified JSON is tokenized into the given sequence of tokens.
         /// Unlike <see cref="AssertTokens(string, JsonToken[])"/>, this does not perform any character
         /// Unlike <see cref="AssertTokens(string, JsonToken[])"/>, this does not perform any character
         /// replacement on the specified JSON, and should be used when the text contains apostrophes which
         /// 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 
+        /// are expected to be used *as* apostrophes. The "end document" token is not specified in the list of
         /// expected tokens, but is implicit.
         /// expected tokens, but is implicit.
         /// </summary>
         /// </summary>
         private static void AssertTokensNoReplacement(string json, params JsonToken[] expectedTokens)
         private static void AssertTokensNoReplacement(string json, params JsonToken[] expectedTokens)

+ 2 - 2
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs

@@ -256,7 +256,7 @@ namespace Google.Protobuf.Reflection
             Assert.AreEqual(unitTestProto3Descriptor, primitiveField.File);
             Assert.AreEqual(unitTestProto3Descriptor, primitiveField.File);
             Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
             Assert.AreEqual(FieldType.Int32, primitiveField.FieldType);
             Assert.IsNull(primitiveField.Proto.Options);
             Assert.IsNull(primitiveField.Proto.Options);
-            
+
             Assert.AreEqual("single_nested_enum", enumField.Name);
             Assert.AreEqual("single_nested_enum", enumField.Name);
             Assert.AreEqual(FieldType.Enum, enumField.FieldType);
             Assert.AreEqual(FieldType.Enum, enumField.FieldType);
             Assert.AreEqual(testAllTypesDescriptor.EnumTypes[0], enumField.EnumType);
             Assert.AreEqual(testAllTypesDescriptor.EnumTypes[0], enumField.EnumType);
@@ -352,7 +352,7 @@ namespace Google.Protobuf.Reflection
         // NestedMessage single_nested_message = 200;
         // NestedMessage single_nested_message = 200;
         [Test]
         [Test]
         public void FieldListOrderings()
         public void FieldListOrderings()
-        { 
+        {
             var fields = TestFieldOrderings.Descriptor.Fields;
             var fields = TestFieldOrderings.Descriptor.Fields;
             Assert.AreEqual(new[] { 11, 1, 101, 200 }, fields.InDeclarationOrder().Select(x => x.FieldNumber));
             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));
             Assert.AreEqual(new[] { 1, 11, 101, 200 }, fields.InFieldNumberOrder().Select(x => x.FieldNumber));

+ 1 - 1
csharp/src/Google.Protobuf.Test/Reflection/FieldAccessTest.cs

@@ -213,6 +213,6 @@ namespace Google.Protobuf.Reflection
             var descriptor = TestAllTypes.Descriptor;
             var descriptor = TestAllTypes.Descriptor;
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields[999999].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields[999999].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields["not found"].ToString());
             Assert.Throws<KeyNotFoundException>(() => descriptor.Fields["not found"].ToString());
-        }        
+        }
     }
     }
 }
 }

+ 1 - 1
csharp/src/Google.Protobuf.Test/SampleEnum.cs

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endregion
 #endregion
-    
+
 namespace Google.Protobuf
 namespace Google.Protobuf
 {
 {
     // Just a sample enum with positive and negative values to be used in tests.
     // Just a sample enum with positive and negative values to be used in tests.

+ 1 - 1
csharp/src/Google.Protobuf.Test/SampleNaNs.cs

@@ -43,7 +43,7 @@ namespace Google.Protobuf
 
 
         // Signalling bit is inverted compared with double.NaN. Doesn't really matter
         // Signalling bit is inverted compared with double.NaN. Doesn't really matter
         // whether that makes it quiet or signalling - it's different.
         // whether that makes it quiet or signalling - it's different.
-        public static double SignallingFlipped { get; } = 
+        public static double SignallingFlipped { get; } =
             BitConverter.Int64BitsToDouble(BitConverter.DoubleToInt64Bits(double.NaN) ^ -0x8000_0000_0000_0000L);
             BitConverter.Int64BitsToDouble(BitConverter.DoubleToInt64Bits(double.NaN) ^ -0x8000_0000_0000_0000L);
 
 
         // A bit in the middle of the mantissa is flipped; this difference is preserved when casting to float.
         // A bit in the middle of the mantissa is flipped; this difference is preserved when casting to float.

+ 7 - 21
csharp/src/Google.Protobuf.Test/TestProtos/MapUnittestProto3.cs

@@ -541,9 +541,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
             mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
@@ -739,9 +737,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (testMap_ == null) {
             if (testMap_ == null) {
@@ -865,9 +861,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec);
             mapInt32Message_.AddEntriesFrom(input, _map_mapInt32Message_codec);
@@ -1007,9 +1001,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             map1_.AddEntriesFrom(input, _map_map1_codec);
             map1_.AddEntriesFrom(input, _map_map1_codec);
@@ -1358,9 +1350,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
             mapInt32Int32_.AddEntriesFrom(input, _map_mapInt32Int32_codec);
@@ -1541,9 +1531,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             type_.AddEntriesFrom(input, _map_type_codec);
             type_.AddEntriesFrom(input, _map_type_codec);
@@ -1678,9 +1666,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             entry_.AddEntriesFrom(input, _map_entry_codec);
             entry_.AddEntriesFrom(input, _map_entry_codec);

+ 3 - 9
csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto3.cs

@@ -2895,9 +2895,7 @@ namespace ProtobufTestMessages.Proto3 {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             OptionalInt32 = input.ReadInt32();
             OptionalInt32 = input.ReadInt32();
@@ -3625,9 +3623,7 @@ namespace ProtobufTestMessages.Proto3 {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 A = input.ReadInt32();
                 A = input.ReadInt32();
@@ -3768,9 +3764,7 @@ namespace ProtobufTestMessages.Proto3 {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             C = input.ReadInt32();
             C = input.ReadInt32();

+ 21 - 63
csharp/src/Google.Protobuf.Test/TestProtos/UnittestCustomOptionsProto3.cs

@@ -352,9 +352,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Field1 = input.ReadString();
             Field1 = input.ReadString();
@@ -480,9 +478,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -583,9 +579,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -686,9 +680,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -789,9 +781,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -892,9 +882,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1008,9 +996,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1111,9 +1097,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1214,9 +1198,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1317,9 +1299,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1420,9 +1400,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1523,9 +1501,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -1714,9 +1690,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Foo = input.ReadInt32();
             Foo = input.ReadInt32();
@@ -1928,9 +1902,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (bar_ == null) {
             if (bar_ == null) {
@@ -2079,9 +2051,7 @@ namespace UnitTest.Issues.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Waldo = input.ReadInt32();
                 Waldo = input.ReadInt32();
@@ -2215,9 +2185,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Qux = input.ReadInt32();
             Qux = input.ReadInt32();
@@ -2325,9 +2293,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -2509,9 +2475,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             I = input.ReadInt32();
             I = input.ReadInt32();
@@ -2651,9 +2615,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Fieldname = input.ReadInt32();
             Fieldname = input.ReadInt32();
@@ -2761,9 +2723,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -2895,9 +2855,7 @@ namespace UnitTest.Issues.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 NestedField = input.ReadInt32();
                 NestedField = input.ReadInt32();

+ 1 - 3
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportProto3.cs

@@ -167,9 +167,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             D = input.ReadInt32();
             D = input.ReadInt32();

+ 1 - 3
csharp/src/Google.Protobuf.Test/TestProtos/UnittestImportPublicProto3.cs

@@ -155,9 +155,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             E = input.ReadInt32();
             E = input.ReadInt32();

+ 13 - 39
csharp/src/Google.Protobuf.Test/TestProtos/UnittestIssues.cs

@@ -181,9 +181,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -286,9 +284,7 @@ namespace UnitTest.Issues.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
             }
             }
           }
           }
@@ -391,9 +387,7 @@ namespace UnitTest.Issues.TestProtos {
               while ((tag = input.ReadTag()) != 0) {
               while ((tag = input.ReadTag()) != 0) {
                 switch(tag) {
                 switch(tag) {
                   default:
                   default:
-                    if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                      return;
-                    }
+                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                     break;
                     break;
                 }
                 }
               }
               }
@@ -560,9 +554,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
             Value = (global::UnitTest.Issues.TestProtos.NegativeEnum) input.ReadEnum();
@@ -677,9 +669,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -909,9 +899,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             PrimitiveValue = input.ReadInt32();
             PrimitiveValue = input.ReadInt32();
@@ -1068,9 +1056,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Item = input.ReadInt32();
             Item = input.ReadInt32();
@@ -1223,9 +1209,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Types_ = input.ReadInt32();
             Types_ = input.ReadInt32();
@@ -1339,9 +1323,7 @@ namespace UnitTest.Issues.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
             }
             }
           }
           }
@@ -1665,9 +1647,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             PlainString = input.ReadString();
             PlainString = input.ReadString();
@@ -1867,9 +1847,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -2069,9 +2047,7 @@ namespace UnitTest.Issues.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Text = input.ReadString();
             Text = input.ReadString();
@@ -2235,9 +2211,7 @@ namespace UnitTest.Issues.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 X = input.ReadInt32();
                 X = input.ReadInt32();

+ 39 - 117
csharp/src/Google.Protobuf.Test/TestProtos/UnittestProto3.cs

@@ -1387,9 +1387,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             SingleInt32 = input.ReadInt32();
             SingleInt32 = input.ReadInt32();
@@ -1757,9 +1755,7 @@ namespace Google.Protobuf.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Bb = input.ReadInt32();
                 Bb = input.ReadInt32();
@@ -1942,9 +1938,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (child_ == null) {
             if (child_ == null) {
@@ -2088,9 +2082,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             DeprecatedInt32 = input.ReadInt32();
             DeprecatedInt32 = input.ReadInt32();
@@ -2223,9 +2215,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             C = input.ReadInt32();
             C = input.ReadInt32();
@@ -2330,9 +2320,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -2463,9 +2451,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (foreignNested_ == null) {
             if (foreignNested_ == null) {
@@ -2628,9 +2614,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             A = input.ReadInt32();
             A = input.ReadInt32();
@@ -2790,9 +2774,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (a_ == null) {
             if (a_ == null) {
@@ -2934,9 +2916,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (bb_ == null) {
             if (bb_ == null) {
@@ -3095,9 +3075,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (a_ == null) {
             if (a_ == null) {
@@ -3233,9 +3211,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = (global::Google.Protobuf.TestProtos.TestEnumWithDupValue) input.ReadEnum();
             Value = (global::Google.Protobuf.TestProtos.TestEnumWithDupValue) input.ReadEnum();
@@ -3507,9 +3483,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             PrimitiveField = input.ReadInt32();
             PrimitiveField = input.ReadInt32();
@@ -3750,9 +3724,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             MyInt = input.ReadInt64();
             MyInt = input.ReadInt64();
@@ -3927,9 +3899,7 @@ namespace Google.Protobuf.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Bb = input.ReadInt32();
                 Bb = input.ReadInt32();
@@ -4067,9 +4037,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             SparseEnum = (global::Google.Protobuf.TestProtos.TestSparseEnum) input.ReadEnum();
             SparseEnum = (global::Google.Protobuf.TestProtos.TestSparseEnum) input.ReadEnum();
@@ -4201,9 +4169,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Data = input.ReadString();
             Data = input.ReadString();
@@ -4324,9 +4290,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             data_.AddEntriesFrom(input, _repeated_data_codec);
             data_.AddEntriesFrom(input, _repeated_data_codec);
@@ -4455,9 +4419,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Data = input.ReadBytes();
             Data = input.ReadBytes();
@@ -4586,9 +4548,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Data = input.ReadBytes();
             Data = input.ReadBytes();
@@ -4720,9 +4680,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Data = input.ReadInt32();
             Data = input.ReadInt32();
@@ -4851,9 +4809,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Data = input.ReadUInt32();
             Data = input.ReadUInt32();
@@ -4982,9 +4938,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Data = input.ReadInt64();
             Data = input.ReadInt64();
@@ -5113,9 +5067,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Data = input.ReadUInt64();
             Data = input.ReadUInt64();
@@ -5244,9 +5196,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Data = input.ReadBool();
             Data = input.ReadBool();
@@ -5463,9 +5413,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             FooInt = input.ReadInt32();
             FooInt = input.ReadInt32();
@@ -5807,9 +5755,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 722:
           case 722:
           case 720: {
           case 720: {
@@ -6208,9 +6154,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 722:
           case 722:
           case 720: {
           case 720: {
@@ -6491,9 +6435,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 98:
           case 98:
           case 101: {
           case 101: {
@@ -6651,9 +6593,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             A = input.ReadString();
             A = input.ReadString();
@@ -6761,9 +6701,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -6864,9 +6802,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -6967,9 +6903,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -7070,9 +7004,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -7173,9 +7105,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -7276,9 +7206,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -7379,9 +7307,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }
@@ -7512,9 +7438,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Text = input.ReadString();
             Text = input.ReadString();
@@ -7661,9 +7585,7 @@ namespace Google.Protobuf.TestProtos {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 10: {
               case 10: {
                 NestedText = input.ReadString();
                 NestedText = input.ReadString();

+ 4 - 12
csharp/src/Google.Protobuf.Test/TestProtos/UnittestWellKnownTypes.cs

@@ -788,9 +788,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             if (anyField_ == null) {
             if (anyField_ == null) {
@@ -1318,9 +1316,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             anyField_.AddEntriesFrom(input, _repeated_anyField_codec);
             anyField_.AddEntriesFrom(input, _repeated_anyField_codec);
@@ -2031,9 +2027,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
             global::Google.Protobuf.WellKnownTypes.Any subBuilder = new global::Google.Protobuf.WellKnownTypes.Any();
@@ -2544,9 +2538,7 @@ namespace Google.Protobuf.TestProtos {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             anyField_.AddEntriesFrom(input, _map_anyField_codec);
             anyField_.AddEntriesFrom(input, _map_anyField_codec);

+ 2 - 2
csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs

@@ -99,7 +99,7 @@ namespace Google.Protobuf.WellKnownTypes
             Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 };
             Duration difference = new Duration { Seconds = 1999, Nanos = Duration.NanosecondsPerSecond - 5000 };
             Assert.AreEqual(difference, t1 - t2);
             Assert.AreEqual(difference, t1 - t2);
             Assert.AreEqual(-difference, t2 - t1);
             Assert.AreEqual(-difference, t2 - t1);
-            
+
             Assert.AreEqual(t1, t2 + difference);
             Assert.AreEqual(t1, t2 + difference);
             Assert.AreEqual(t2, t1 - difference);
             Assert.AreEqual(t2, t1 - difference);
         }
         }
@@ -190,7 +190,7 @@ namespace Google.Protobuf.WellKnownTypes
             Assert.IsTrue(e > d);
             Assert.IsTrue(e > d);
             Assert.IsTrue(e == e);
             Assert.IsTrue(e == e);
             Assert.IsTrue(e == e.Clone());
             Assert.IsTrue(e == e.Clone());
-            
+
             Assert.IsTrue(b >= a);
             Assert.IsTrue(b >= a);
             Assert.IsTrue(b <= c);
             Assert.IsTrue(b <= c);
             Assert.IsTrue(b <= d);
             Assert.IsTrue(b <= d);

+ 2 - 2
csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs

@@ -135,7 +135,7 @@ namespace Google.Protobuf.WellKnownTypes
                 DoubleField = { 12.5, -1.5, 0d },
                 DoubleField = { 12.5, -1.5, 0d },
                 FloatField = { 123.25f, -20f, 0f },
                 FloatField = { 123.25f, -20f, 0f },
                 Int32Field = { int.MaxValue, int.MinValue, 0 },
                 Int32Field = { int.MaxValue, int.MinValue, 0 },
-                Int64Field = { long.MaxValue, long.MinValue, 0L },                
+                Int64Field = { long.MaxValue, long.MinValue, 0L },
                 StringField = { "First", "Second", "" },
                 StringField = { "First", "Second", "" },
                 Uint32Field = { uint.MaxValue, uint.MinValue, 0U },
                 Uint32Field = { uint.MaxValue, uint.MinValue, 0U },
                 Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL },
                 Uint64Field = { ulong.MaxValue, ulong.MinValue, 0UL },
@@ -403,7 +403,7 @@ namespace Google.Protobuf.WellKnownTypes
 
 
             output.Flush();
             output.Flush();
             stream.Position = 0;
             stream.Position = 0;
-            
+
             var message = TestWellKnownTypes.Parser.ParseFrom(stream);
             var message = TestWellKnownTypes.Parser.ParseFrom(stream);
             Assert.AreEqual(6, message.Int32Field);
             Assert.AreEqual(6, message.Int32Field);
         }
         }

+ 2 - 2
csharp/src/Google.Protobuf/FieldCodec.cs

@@ -292,7 +292,7 @@ namespace Google.Protobuf
 
 
             /// <summary>
             /// <summary>
             /// Returns a field codec which effectively wraps a value of type T in a message.
             /// Returns a field codec which effectively wraps a value of type T in a message.
-            /// 
+            ///
             /// </summary>
             /// </summary>
             internal static FieldCodec<T> GetCodec<T>()
             internal static FieldCodec<T> GetCodec<T>()
             {
             {
@@ -431,7 +431,7 @@ namespace Google.Protobuf
         internal T DefaultValue { get; }
         internal T DefaultValue { get; }
 
 
         private readonly int tagSize;
         private readonly int tagSize;
-        
+
         internal FieldCodec(
         internal FieldCodec(
                 Func<CodedInputStream, T> reader,
                 Func<CodedInputStream, T> reader,
                 Action<CodedOutputStream, T> writer,
                 Action<CodedOutputStream, T> writer,

+ 3 - 3
csharp/src/Google.Protobuf/FieldMaskTree.cs

@@ -41,7 +41,7 @@ namespace Google.Protobuf
     /// <summary>
     /// <summary>
     /// <para>A tree representation of a FieldMask. Each leaf node in this tree represent
     /// <para>A tree representation of a FieldMask. Each leaf node in this tree represent
     /// a field path in the FieldMask.</para>
     /// a field path in the FieldMask.</para>
-    /// 
+    ///
     /// <para>For example, FieldMask "foo.bar,foo.baz,bar.baz" as a tree will be:</para>
     /// <para>For example, FieldMask "foo.bar,foo.baz,bar.baz" as a tree will be:</para>
     /// <code>
     /// <code>
     ///   [root] -+- foo -+- bar
     ///   [root] -+- foo -+- bar
@@ -50,7 +50,7 @@ namespace Google.Protobuf
     ///           |
     ///           |
     ///           +- bar --- baz
     ///           +- bar --- baz
     /// </code>
     /// </code>
-    /// 
+    ///
     /// <para>By representing FieldMasks with this tree structure we can easily convert
     /// <para>By representing FieldMasks with this tree structure we can easily convert
     /// a FieldMask to a canonical form, merge two FieldMasks, calculate the
     /// a FieldMask to a canonical form, merge two FieldMasks, calculate the
     /// intersection to two FieldMasks and traverse all fields specified by the
     /// intersection to two FieldMasks and traverse all fields specified by the
@@ -242,7 +242,7 @@ namespace Google.Protobuf
 
 
             Merge(root, "", source, destination, options);
             Merge(root, "", source, destination, options);
         }
         }
-        
+
         /// <summary>
         /// <summary>
         /// Merges all fields specified by a sub-tree from <paramref name="source"/> to <paramref name="destination"/>.
         /// Merges all fields specified by a sub-tree from <paramref name="source"/> to <paramref name="destination"/>.
         /// </summary>
         /// </summary>

+ 2 - 2
csharp/src/Google.Protobuf/Google.Protobuf.csproj

@@ -20,7 +20,7 @@
     <RepositoryUrl>https://github.com/protocolbuffers/protobuf.git</RepositoryUrl>
     <RepositoryUrl>https://github.com/protocolbuffers/protobuf.git</RepositoryUrl>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <!-- 
+  <!--
     - Override target frameworks on non-Windows to just .NET Core
     - Override target frameworks on non-Windows to just .NET Core
     - Doing this conditionally in the initial PropertyGroup confuses
     - Doing this conditionally in the initial PropertyGroup confuses
     - Visual Studio.
     - Visual Studio.
@@ -30,7 +30,7 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="SourceLink.Create.CommandLine" PrivateAssets="All" Version="2.7.6"/> 
+    <PackageReference Include="SourceLink.Create.CommandLine" PrivateAssets="All" Version="2.7.6"/>
   </ItemGroup>
   </ItemGroup>
 
 
 </Project>
 </Project>

+ 4 - 4
csharp/src/Google.Protobuf/JsonFormatter.cs

@@ -70,7 +70,7 @@ namespace Google.Protobuf
         /// </summary>
         /// </summary>
         public static JsonFormatter Default { get; } = new JsonFormatter(Settings.Default);
         public static JsonFormatter Default { get; } = new JsonFormatter(Settings.Default);
 
 
-        // A JSON formatter which *only* exists 
+        // A JSON formatter which *only* exists
         private static readonly JsonFormatter diagnosticFormatter = new JsonFormatter(Settings.Default);
         private static readonly JsonFormatter diagnosticFormatter = new JsonFormatter(Settings.Default);
 
 
         /// <summary>
         /// <summary>
@@ -579,7 +579,7 @@ namespace Google.Protobuf
             writer.Write(data.ToBase64());
             writer.Write(data.ToBase64());
             writer.Write('"');
             writer.Write('"');
             writer.Write(" }");
             writer.Write(" }");
-        }        
+        }
 
 
         private void WriteStruct(TextWriter writer, IMessage message)
         private void WriteStruct(TextWriter writer, IMessage message)
         {
         {
@@ -616,7 +616,7 @@ namespace Google.Protobuf
             }
             }
 
 
             object value = specifiedField.Accessor.GetValue(message);
             object value = specifiedField.Accessor.GetValue(message);
-            
+
             switch (specifiedField.FieldNumber)
             switch (specifiedField.FieldNumber)
             {
             {
                 case Value.BoolValueFieldNumber:
                 case Value.BoolValueFieldNumber:
@@ -871,7 +871,7 @@ namespace Google.Protobuf
             // the platforms we target have it.
             // the platforms we target have it.
             private static readonly Dictionary<System.Type, Dictionary<object, string>> dictionaries
             private static readonly Dictionary<System.Type, Dictionary<object, string>> dictionaries
                 = new Dictionary<System.Type, Dictionary<object, string>>();
                 = new Dictionary<System.Type, Dictionary<object, string>>();
-            
+
             internal static string GetOriginalName(object value)
             internal static string GetOriginalName(object value)
             {
             {
                 var enumType = value.GetType();
                 var enumType = value.GetType();

+ 2 - 2
csharp/src/Google.Protobuf/JsonParser.cs

@@ -674,7 +674,7 @@ namespace Google.Protobuf
             if (value != Math.Floor(value))
             if (value != Math.Floor(value))
             {
             {
                 throw new InvalidProtocolBufferException($"Value not an integer: {value}");
                 throw new InvalidProtocolBufferException($"Value not an integer: {value}");
-            }            
+            }
         }
         }
 
 
         private static object ParseSingleStringValue(FieldDescriptor field, string text)
         private static object ParseSingleStringValue(FieldDescriptor field, string text)
@@ -919,7 +919,7 @@ namespace Google.Protobuf
                 messagePaths.Add(ToSnakeCase(path));
                 messagePaths.Add(ToSnakeCase(path));
             }
             }
         }
         }
-        
+
         // Ported from src/google/protobuf/util/internal/utility.cc
         // Ported from src/google/protobuf/util/internal/utility.cc
         private static string ToSnakeCase(string text)
         private static string ToSnakeCase(string text)
         {
         {

+ 2 - 2
csharp/src/Google.Protobuf/JsonTokenizer.cs

@@ -614,7 +614,7 @@ namespace Google.Protobuf
             /// where ^ represents the current position within the text stream. The examples all use string values,
             /// where ^ represents the current position within the text stream. The examples all use string values,
             /// but could be any value, including nested objects/arrays.
             /// but could be any value, including nested objects/arrays.
             /// The complete state of the tokenizer also includes a stack to indicate the contexts (arrays/objects).
             /// The complete state of the tokenizer also includes a stack to indicate the contexts (arrays/objects).
-            /// Any additional notional state of "AfterValue" indicates that a value has been completed, at which 
+            /// Any additional notional state of "AfterValue" indicates that a value has been completed, at which
             /// point there's an immediate transition to ExpectedEndOfDocument,  ObjectAfterProperty or ArrayAfterValue.
             /// point there's an immediate transition to ExpectedEndOfDocument,  ObjectAfterProperty or ArrayAfterValue.
             /// </para>
             /// </para>
             /// <para>
             /// <para>
@@ -655,7 +655,7 @@ namespace Google.Protobuf
                 /// <summary>
                 /// <summary>
                 /// { "foo" : ^ "bar", "x": "y" }
                 /// { "foo" : ^ "bar", "x": "y" }
                 /// Before any property other than the first in an object.
                 /// Before any property other than the first in an object.
-                /// (Equivalently: after any property in an object) 
+                /// (Equivalently: after any property in an object)
                 /// Next states:
                 /// Next states:
                 /// "AfterValue" (value is simple)
                 /// "AfterValue" (value is simple)
                 /// ObjectStart (value is object)
                 /// ObjectStart (value is object)

+ 1 - 1
csharp/src/Google.Protobuf/LimitedInputStream.cs

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endregion
 #endregion
-    
+
 using System;
 using System;
 using System.IO;
 using System.IO;
 
 

+ 3 - 3
csharp/src/Google.Protobuf/MessageExtensions.cs

@@ -163,12 +163,12 @@ namespace Google.Protobuf
                         var map = (IDictionary)f.Accessor.GetValue(message);
                         var map = (IDictionary)f.Accessor.GetValue(message);
                         return map.Values.OfType<IMessage>().All(IsInitialized);
                         return map.Values.OfType<IMessage>().All(IsInitialized);
                     }
                     }
-                    else if (f.IsRepeated && f.MessageType != null)
+                    else if (f.IsRepeated && f.FieldType == FieldType.Message || f.FieldType == FieldType.Group)
                     {
                     {
                         var enumerable = (IEnumerable)f.Accessor.GetValue(message);
                         var enumerable = (IEnumerable)f.Accessor.GetValue(message);
                         return enumerable.Cast<IMessage>().All(IsInitialized);
                         return enumerable.Cast<IMessage>().All(IsInitialized);
                     }
                     }
-                    else if (f.MessageType != null)
+                    else if (f.FieldType == FieldType.Message || f.FieldType == FieldType.Group)
                     {
                     {
                         if (f.Accessor.HasValue(message))
                         if (f.Accessor.HasValue(message))
                         {
                         {
@@ -183,7 +183,7 @@ namespace Google.Protobuf
                     {
                     {
                         return f.Accessor.HasValue(message);
                         return f.Accessor.HasValue(message);
                     }
                     }
-                    else 
+                    else
                     {
                     {
                         return true;
                         return true;
                     }
                     }

+ 2 - 2
csharp/src/Google.Protobuf/MessageParser.cs

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #endregion
 #endregion
-    
+
 using System;
 using System;
 using System.IO;
 using System.IO;
 
 
@@ -210,7 +210,7 @@ namespace Google.Protobuf
         // The current implementation avoids a virtual method call and a cast, which *may* be significant in some cases.
         // The current implementation avoids a virtual method call and a cast, which *may* be significant in some cases.
         // Benchmarking work is required to measure the significance - but it's only a few lines of code in any case.
         // Benchmarking work is required to measure the significance - but it's only a few lines of code in any case.
         // The API wouldn't change anyway - just the implementation - so this work can be deferred.
         // The API wouldn't change anyway - just the implementation - so this work can be deferred.
-        private readonly Func<T> factory; 
+        private readonly Func<T> factory;
 
 
         /// <summary>
         /// <summary>
         /// Creates a new parser.
         /// Creates a new parser.

+ 3 - 3
csharp/src/Google.Protobuf/Reflection/CustomOptions.cs

@@ -63,7 +63,7 @@ namespace Google.Protobuf.Reflection
         /// Singleton for all descriptors with an empty set of options.
         /// Singleton for all descriptors with an empty set of options.
         /// </summary>
         /// </summary>
         internal static readonly CustomOptions Empty = new CustomOptions();
         internal static readonly CustomOptions Empty = new CustomOptions();
-        
+
         /// <summary>
         /// <summary>
         /// A sequence of values per field. This needs to be per field rather than per tag to allow correct deserialization
         /// A sequence of values per field. This needs to be per field rather than per tag to allow correct deserialization
         /// of repeated fields which could be "int, ByteString, int" - unlikely as that is. The fact that values are boxed
         /// of repeated fields which could be "int, ByteString, int" - unlikely as that is. The fact that values are boxed
@@ -147,7 +147,7 @@ namespace Google.Protobuf.Reflection
         /// <param name="value">The output variable to populate.</param>
         /// <param name="value">The output variable to populate.</param>
         /// <returns><c>true</c> if a suitable value for the field was found; <c>false</c> otherwise.</returns>
         /// <returns><c>true</c> if a suitable value for the field was found; <c>false</c> otherwise.</returns>
         public bool TryGetSFixed64(int field, out long value) => TryGetInt64(field, out value);
         public bool TryGetSFixed64(int field, out long value) => TryGetInt64(field, out value);
-        
+
         /// <summary>
         /// <summary>
         /// Retrieves a signed 32-bit integer value for the specified option field,
         /// Retrieves a signed 32-bit integer value for the specified option field,
         /// assuming a zigzag encoding.
         /// assuming a zigzag encoding.
@@ -357,7 +357,7 @@ namespace Google.Protobuf.Reflection
             List<FieldValue> valuesForField;
             List<FieldValue> valuesForField;
             if (!ret.valuesByField.TryGetValue(field, out valuesForField))
             if (!ret.valuesByField.TryGetValue(field, out valuesForField))
             {
             {
-                // Expect almost all 
+                // Expect almost all
                 valuesForField = new List<FieldValue>(1);
                 valuesForField = new List<FieldValue>(1);
                 ret.valuesByField[field] = valuesForField;
                 ret.valuesByField[field] = valuesForField;
             }
             }

+ 19 - 57
csharp/src/Google.Protobuf/Reflection/Descriptor.cs

@@ -302,9 +302,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             file_.AddEntriesFrom(input, _repeated_file_codec);
             file_.AddEntriesFrom(input, _repeated_file_codec);
@@ -735,9 +733,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -1102,9 +1098,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -1363,9 +1357,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Start = input.ReadInt32();
                 Start = input.ReadInt32();
@@ -1568,9 +1560,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Start = input.ReadInt32();
                 Start = input.ReadInt32();
@@ -1703,9 +1693,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 7994: {
           case 7994: {
             uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
             uninterpretedOption_.AddEntriesFrom(input, _repeated_uninterpretedOption_codec);
@@ -2212,9 +2200,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -2501,9 +2487,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -2748,9 +2732,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -2966,9 +2948,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 8: {
               case 8: {
                 Start = input.ReadInt32();
                 Start = input.ReadInt32();
@@ -3197,9 +3177,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -3407,9 +3385,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -3759,9 +3735,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -6949,9 +6923,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 18: {
           case 18: {
             name_.AddEntriesFrom(input, _repeated_name_codec);
             name_.AddEntriesFrom(input, _repeated_name_codec);
@@ -7164,9 +7136,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 10: {
               case 10: {
                 NamePart_ = input.ReadString();
                 NamePart_ = input.ReadString();
@@ -7345,9 +7315,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             location_.AddEntriesFrom(input, _repeated_location_codec);
             location_.AddEntriesFrom(input, _repeated_location_codec);
@@ -7655,9 +7623,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 10:
               case 10:
               case 8: {
               case 8: {
@@ -7810,9 +7776,7 @@ namespace Google.Protobuf.Reflection {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             annotation_.AddEntriesFrom(input, _repeated_annotation_codec);
             annotation_.AddEntriesFrom(input, _repeated_annotation_codec);
@@ -8063,9 +8027,7 @@ namespace Google.Protobuf.Reflection {
           while ((tag = input.ReadTag()) != 0) {
           while ((tag = input.ReadTag()) != 0) {
             switch(tag) {
             switch(tag) {
               default:
               default:
-                if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-                  return;
-                }
+                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                 break;
                 break;
               case 10:
               case 10:
               case 8: {
               case 8: {

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/DescriptorBase.cs

@@ -47,7 +47,7 @@ namespace Google.Protobuf.Reflection
         }
         }
 
 
         /// <value>
         /// <value>
-        /// The index of this descriptor within its parent descriptor. 
+        /// The index of this descriptor within its parent descriptor.
         /// </value>
         /// </value>
         /// <remarks>
         /// <remarks>
         /// This returns the index of this descriptor within its parent, for
         /// This returns the index of this descriptor within its parent, for

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/EnumValueDescriptor.cs

@@ -35,7 +35,7 @@ namespace Google.Protobuf.Reflection
     /// <summary>
     /// <summary>
     /// Descriptor for a single enum value within an enum in a .proto file.
     /// Descriptor for a single enum value within an enum in a .proto file.
     /// </summary>
     /// </summary>
-    public sealed class EnumValueDescriptor : DescriptorBase                                            
+    public sealed class EnumValueDescriptor : DescriptorBase
     {
     {
         private readonly EnumDescriptor enumDescriptor;
         private readonly EnumDescriptor enumDescriptor;
         private readonly EnumValueDescriptorProto proto;
         private readonly EnumValueDescriptorProto proto;

+ 2 - 2
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@@ -98,7 +98,7 @@ namespace Google.Protobuf.Reflection
             this.propertyName = propertyName;
             this.propertyName = propertyName;
             JsonName =  Proto.JsonName == "" ? JsonFormatter.ToJsonName(Proto.Name) : Proto.JsonName;
             JsonName =  Proto.JsonName == "" ? JsonFormatter.ToJsonName(Proto.Name) : Proto.JsonName;
         }
         }
-    
+
 
 
         /// <summary>
         /// <summary>
         /// The brief name of the descriptor's target.
         /// The brief name of the descriptor's target.
@@ -129,7 +129,7 @@ namespace Google.Protobuf.Reflection
         /// </para>
         /// </para>
         /// </remarks>
         /// </remarks>
         public IFieldAccessor Accessor => accessor;
         public IFieldAccessor Accessor => accessor;
-        
+
         /// <summary>
         /// <summary>
         /// Maps a field type as included in the .proto file to a FieldType.
         /// Maps a field type as included in the .proto file to a FieldType.
         /// </summary>
         /// </summary>

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/IDescriptor.cs

@@ -51,5 +51,5 @@ namespace Google.Protobuf.Reflection
         /// Returns the descriptor for the .proto file that this entity is part of.
         /// Returns the descriptor for the .proto file that this entity is part of.
         /// </summary>
         /// </summary>
         FileDescriptor File { get; }
         FileDescriptor File { get; }
-    }    
+    }
 }
 }

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs

@@ -63,7 +63,7 @@ namespace Google.Protobuf.Reflection
         private readonly IList<FieldDescriptor> fieldsInDeclarationOrder;
         private readonly IList<FieldDescriptor> fieldsInDeclarationOrder;
         private readonly IList<FieldDescriptor> fieldsInNumberOrder;
         private readonly IList<FieldDescriptor> fieldsInNumberOrder;
         private readonly IDictionary<string, FieldDescriptor> jsonFieldMap;
         private readonly IDictionary<string, FieldDescriptor> jsonFieldMap;
-        
+
         internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, GeneratedClrTypeInfo generatedCodeInfo)
         internal MessageDescriptor(DescriptorProto proto, FileDescriptor file, MessageDescriptor parent, int typeIndex, GeneratedClrTypeInfo generatedCodeInfo)
             : base(file, file.ComputeFullName(parent, proto.Name), typeIndex)
             : base(file, file.ComputeFullName(parent, proto.Name), typeIndex)
         {
         {

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/OneofAccessor.cs

@@ -45,7 +45,7 @@ namespace Google.Protobuf.Reflection
         private readonly Action<IMessage> clearDelegate;
         private readonly Action<IMessage> clearDelegate;
         private OneofDescriptor descriptor;
         private OneofDescriptor descriptor;
 
 
-        internal OneofAccessor(PropertyInfo caseProperty, MethodInfo clearMethod, OneofDescriptor descriptor) 
+        internal OneofAccessor(PropertyInfo caseProperty, MethodInfo clearMethod, OneofDescriptor descriptor)
         {
         {
             if (!caseProperty.CanRead)
             if (!caseProperty.CanRead)
             {
             {

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/OriginalNameAttribute.cs

@@ -60,6 +60,6 @@ namespace Google.Protobuf.Reflection
             Name = ProtoPreconditions.CheckNotNull(name, nameof(name));
             Name = ProtoPreconditions.CheckNotNull(name, nameof(name));
             PreferredAlias = true;
             PreferredAlias = true;
         }
         }
-	
+
     }
     }
 }
 }

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/SingleFieldAccessor.cs

@@ -77,7 +77,7 @@ namespace Google.Protobuf.Reflection
                 };
                 };
                 var clrType = property.PropertyType;
                 var clrType = property.PropertyType;
 
 
-                // TODO: Validate that this is a reasonable single field? (Should be a value type, a message type, or string/ByteString.) 
+                // TODO: Validate that this is a reasonable single field? (Should be a value type, a message type, or string/ByteString.)
                 object defaultValue =
                 object defaultValue =
                     descriptor.FieldType == FieldType.Message ? null
                     descriptor.FieldType == FieldType.Message ? null
                     : clrType == typeof(string) ? ""
                     : clrType == typeof(string) ? ""

+ 2 - 2
csharp/src/Google.Protobuf/UnknownField.cs

@@ -171,7 +171,7 @@ namespace Google.Protobuf
             {
             {
                 result += CodedOutputStream.ComputeTagSize(fieldNumber) * fixed64List.Count;
                 result += CodedOutputStream.ComputeTagSize(fieldNumber) * fixed64List.Count;
                 result += CodedOutputStream.ComputeFixed64Size(1) * fixed64List.Count;
                 result += CodedOutputStream.ComputeFixed64Size(1) * fixed64List.Count;
-            }                
+            }
             if (lengthDelimitedList != null)
             if (lengthDelimitedList != null)
             {
             {
                 result += CodedOutputStream.ComputeTagSize(fieldNumber) * lengthDelimitedList.Count;
                 result += CodedOutputStream.ComputeTagSize(fieldNumber) * lengthDelimitedList.Count;
@@ -266,7 +266,7 @@ namespace Google.Protobuf
             return this;
             return this;
         }
         }
 
 
-        internal UnknownField AddGroup(UnknownFieldSet value) 
+        internal UnknownField AddGroup(UnknownFieldSet value)
         {
         {
             groupList = Add(groupList, value);
             groupList = Add(groupList, value);
             return this;
             return this;

+ 0 - 23
csharp/src/Google.Protobuf/UnknownFieldSet.cs

@@ -260,29 +260,6 @@ namespace Google.Protobuf
             }
             }
             return unknownFields;
             return unknownFields;
         }
         }
-
-        /// <summary>
-        /// Create a new UnknownFieldSet if unknownFields is null.
-        /// Parse a single field from <paramref name="input"/> and merge it
-        /// into unknownFields. If <paramref name="input"/> is configured to discard unknown fields,
-        /// <paramref name="unknownFields"/> will be returned as-is and the field will be skipped.
-        /// </summary>
-        /// <param name="unknownFields">The UnknownFieldSet which need to be merged</param>
-        /// <param name="input">The coded input stream containing the field</param>
-        /// <returns>The merged UnknownFieldSet</returns>
-        public static bool MergeFieldFrom(ref UnknownFieldSet unknownFields, CodedInputStream input)
-        {
-            if (input.DiscardUnknownFields)
-            {
-                input.SkipLastField();
-                return true;
-            }
-            if (unknownFields == null)
-            {
-                unknownFields = new UnknownFieldSet();
-            }
-            return unknownFields.MergeFieldFrom(input);
-        }
 
 
         /// <summary>
         /// <summary>
         /// Merges the fields from <paramref name="other"/> into this set.
         /// Merges the fields from <paramref name="other"/> into this set.

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/Any.cs

@@ -292,9 +292,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             TypeUrl = input.ReadString();
             TypeUrl = input.ReadString();

+ 1 - 1
csharp/src/Google.Protobuf/WellKnownTypes/AnyPartial.cs

@@ -49,7 +49,7 @@ namespace Google.Protobuf.WellKnownTypes
         /// </summary>
         /// </summary>
         /// <remarks>
         /// <remarks>
         /// <para>
         /// <para>
-        /// This is always just the last part of the URL, after the final slash. No validation of 
+        /// This is always just the last part of the URL, after the final slash. No validation of
         /// anything before the trailing slash is performed. If the type URL does not include a slash,
         /// anything before the trailing slash is performed. If the type URL does not include a slash,
         /// an empty string is returned rather than an exception being thrown; this won't match any types,
         /// an empty string is returned rather than an exception being thrown; this won't match any types,
         /// and the calling code is probably in a better position to give a meaningful error.
         /// and the calling code is probably in a better position to give a meaningful error.

+ 3 - 9
csharp/src/Google.Protobuf/WellKnownTypes/Api.cs

@@ -345,9 +345,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -663,9 +661,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -929,9 +925,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/Duration.cs

@@ -254,9 +254,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Seconds = input.ReadInt64();
             Seconds = input.ReadInt64();

+ 1 - 1
csharp/src/Google.Protobuf/WellKnownTypes/DurationPartial.cs

@@ -156,7 +156,7 @@ namespace Google.Protobuf.WellKnownTypes
                 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos);
                 return Normalize(lhs.Seconds - rhs.Seconds, lhs.Nanos - rhs.Nanos);
             }
             }
         }
         }
-        
+
         /// <summary>
         /// <summary>
         /// Creates a duration with the normalized values from the given number of seconds and
         /// Creates a duration with the normalized values from the given number of seconds and
         /// nanoseconds, conforming with the description in the proto file.
         /// nanoseconds, conforming with the description in the proto file.

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/Empty.cs

@@ -143,9 +143,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
         }
         }
       }
       }

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/FieldMask.cs

@@ -352,9 +352,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             paths_.AddEntriesFrom(input, _repeated_paths_codec);
             paths_.AddEntriesFrom(input, _repeated_paths_codec);

+ 1 - 1
csharp/src/Google.Protobuf/WellKnownTypes/FieldMaskPartial.cs

@@ -358,7 +358,7 @@ namespace Google.Protobuf.WellKnownTypes
             /// field is set in the source, the value is copied to the
             /// field is set in the source, the value is copied to the
             /// destination; if the field is unset in the source, the field is cleared
             /// destination; if the field is unset in the source, the field is cleared
             /// from the destination) when merging.
             /// from the destination) when merging.
-            /// 
+            ///
             /// Default behavior is to always set the value of the source primitive
             /// Default behavior is to always set the value of the source primitive
             /// field to the destination primitive field, and if the source field is
             /// field to the destination primitive field, and if the source field is
             /// unset, the default value of the source field is copied to the
             /// unset, the default value of the source field is copied to the

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/SourceContext.cs

@@ -165,9 +165,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             FileName = input.ReadString();
             FileName = input.ReadString();

+ 3 - 9
csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs

@@ -189,9 +189,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             fields_.AddEntriesFrom(input, _map_fields_codec);
             fields_.AddEntriesFrom(input, _map_fields_codec);
@@ -515,9 +513,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             kind_ = input.ReadEnum();
             kind_ = input.ReadEnum();
@@ -677,9 +673,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             values_.AddEntriesFrom(input, _repeated_values_codec);
             values_.AddEntriesFrom(input, _repeated_values_codec);

+ 1 - 3
csharp/src/Google.Protobuf/WellKnownTypes/Timestamp.cs

@@ -273,9 +273,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Seconds = input.ReadInt64();
             Seconds = input.ReadInt64();

+ 5 - 15
csharp/src/Google.Protobuf/WellKnownTypes/Type.cs

@@ -328,9 +328,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -725,9 +723,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
             Kind = (global::Google.Protobuf.WellKnownTypes.Field.Types.Kind) input.ReadEnum();
@@ -1104,9 +1100,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -1306,9 +1300,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();
@@ -1488,9 +1480,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Name = input.ReadString();
             Name = input.ReadString();

+ 9 - 27
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs

@@ -177,9 +177,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 9: {
           case 9: {
             Value = input.ReadDouble();
             Value = input.ReadDouble();
@@ -316,9 +314,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 13: {
           case 13: {
             Value = input.ReadFloat();
             Value = input.ReadFloat();
@@ -455,9 +451,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = input.ReadInt64();
             Value = input.ReadInt64();
@@ -594,9 +588,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = input.ReadUInt64();
             Value = input.ReadUInt64();
@@ -733,9 +725,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = input.ReadInt32();
             Value = input.ReadInt32();
@@ -872,9 +862,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = input.ReadUInt32();
             Value = input.ReadUInt32();
@@ -1011,9 +999,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 8: {
           case 8: {
             Value = input.ReadBool();
             Value = input.ReadBool();
@@ -1150,9 +1136,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Value = input.ReadString();
             Value = input.ReadString();
@@ -1289,9 +1273,7 @@ namespace Google.Protobuf.WellKnownTypes {
       while ((tag = input.ReadTag()) != 0) {
       while ((tag = input.ReadTag()) != 0) {
         switch(tag) {
         switch(tag) {
           default:
           default:
-            if (!pb::UnknownFieldSet.MergeFieldFrom(ref _unknownFields, input)) {
-              return;
-            }
+            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
             break;
             break;
           case 10: {
           case 10: {
             Value = input.ReadBytes();
             Value = input.ReadBytes();

+ 1 - 1
docs/options.md

@@ -192,7 +192,7 @@ with info about your project (name and website) so we can add an entry for you.
 1. CGSN Mooring Project
 1. CGSN Mooring Project
    * Website: https://bitbucket.org/ooicgsn/cgsn-mooring
    * Website: https://bitbucket.org/ooicgsn/cgsn-mooring
    * Extensions: 1058
    * Extensions: 1058
-   
+
 1. Container Storage Interface
 1. Container Storage Interface
    * Website: https://github.com/container-storage-interface/spec
    * Website: https://github.com/container-storage-interface/spec
    * Extensions: 1059-1069
    * Extensions: 1059-1069

+ 4 - 4
docs/performance.md

@@ -9,16 +9,16 @@ This table contains 3 languages' results:
     * **reuse** - This is for reusing the same message instance for parsing.
     * **reuse** - This is for reusing the same message instance for parsing.
 * **Java** - For Java there're 3 kinds of parsing/Serialization ways:
 * **Java** - For Java there're 3 kinds of parsing/Serialization ways:
 	* **byte[]** - This is for parsing from a Byte Array.
 	* **byte[]** - This is for parsing from a Byte Array.
-    * **ByteString** - This is for parsing from a 
+    * **ByteString** - This is for parsing from a
     	com.google.protobuf.ByteString.
     	com.google.protobuf.ByteString.
     * **InputStream** - This is for parsing from a InputStream
     * **InputStream** - This is for parsing from a InputStream
 * **Python** - For Pythong there're 3 kinds of python protobuf for testing:
 * **Python** - For Pythong there're 3 kinds of python protobuf for testing:
-	* **C++-genereated-code** - This is for using cpp generated code of the 
+	* **C++-genereated-code** - This is for using cpp generated code of the
     	proto file as dynamic linked library.
     	proto file as dynamic linked library.
 	* **C++-reflection** - This is for using cpp reflection, which there's no
 	* **C++-reflection** - This is for using cpp reflection, which there's no
-    	generated code, but still using cpp protobuf library as dynamic linked 
+    	generated code, but still using cpp protobuf library as dynamic linked
         library.
         library.
-	* **pure-Python** - This is for pure Python version, which don't link with 
+	* **pure-Python** - This is for pure Python version, which don't link with
     	any cpp protobuf library.
     	any cpp protobuf library.
 
 
 ## Parsing performance
 ## Parsing performance

+ 3 - 2
docs/third_party.md

@@ -19,7 +19,6 @@ These are projects we know about implementing Protocol Buffers for other program
 * C++: https://github.com/google/protobuf (Google-official implementation)
 * C++: https://github.com/google/protobuf (Google-official implementation)
 * C/C++: http://spbc.sf.net/
 * C/C++: http://spbc.sf.net/
 * C#: http://code.google.com/p/protobuf-csharp-port
 * C#: http://code.google.com/p/protobuf-csharp-port
-* C#: http://code.google.com/p/protosharp/
 * C#: https://silentorbit.com/protobuf/
 * C#: https://silentorbit.com/protobuf/
 * C#/.NET/WCF/VB: http://code.google.com/p/protobuf-net/
 * C#/.NET/WCF/VB: http://code.google.com/p/protobuf-net/
 * Clojure: http://github.com/ninjudd/clojure-protobuf
 * Clojure: http://github.com/ninjudd/clojure-protobuf
@@ -39,6 +38,7 @@ These are projects we know about implementing Protocol Buffers for other program
 * Erlang: https://github.com/tomas-abrahamsson/gpb
 * Erlang: https://github.com/tomas-abrahamsson/gpb
 * Erlang: http://piqi.org/
 * Erlang: http://piqi.org/
 * Erlang: https://github.com/basho/erlang_protobuffs (no longer maintained, use gpb instead)
 * 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)
 * GDScript: https://github.com/oniksan/godobuf (Godot v3 engine plugin)
 * Go: https://github.com/golang/protobuf (Google-official implementation)
 * Go: https://github.com/golang/protobuf (Google-official implementation)
 * Go: https://github.com/akunspy/gopbuf
 * Go: https://github.com/akunspy/gopbuf
@@ -92,6 +92,7 @@ These are projects we know about implementing Protocol Buffers for other program
 * Solidity: https://github.com/celer-network/pb3-gen-sol
 * Solidity: https://github.com/celer-network/pb3-gen-sol
 * Swift: https://github.com/alexeyxo/protobuf-swift
 * Swift: https://github.com/alexeyxo/protobuf-swift
 * Swift: https://github.com/apple/swift-protobuf/
 * Swift: https://github.com/apple/swift-protobuf/
+* Typescript: https://github.com/y3llowcake/protoc-gen-ts
 * Vala: https://launchpad.net/protobuf-vala
 * Vala: https://launchpad.net/protobuf-vala
 * Visual Basic: http://code.google.com/p/protobuf-net/
 * Visual Basic: http://code.google.com/p/protobuf-net/
 
 
@@ -171,4 +172,4 @@ There are miscellaneous other things you may find useful as a Protocol Buffers d
 * [Make protoc plugins in NodeJS](https://github.com/konsumer/node-protoc-plugin)
 * [Make protoc plugins in NodeJS](https://github.com/konsumer/node-protoc-plugin)
 * [ProfaneDB - A Protocol Buffers database](https://profanedb.gitlab.io)
 * [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)
 * [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) 
+* [Protolock - CLI utility to prevent backward-incompatible changes to .proto files](https://github.com/nilslice/protolock)

+ 1 - 1
examples/list_people_test.go

@@ -34,7 +34,7 @@ func TestWritePersonWritesPerson(t *testing.T) {
 
 
 func TestListPeopleWritesList(t *testing.T) {
 func TestListPeopleWritesList(t *testing.T) {
 	buf := new(bytes.Buffer)
 	buf := new(bytes.Buffer)
-	in := pb.AddressBook{People: []*pb.Person {
+	in := pb.AddressBook{People: []*pb.Person{
 		{
 		{
 			Name:  "John Doe",
 			Name:  "John Doe",
 			Id:    101,
 			Id:    101,

+ 1 - 1
java/compatibility_tests/v2.5.0/more_protos/src/proto/google/protobuf/unittest_optimize_for.proto

@@ -55,7 +55,7 @@ message TestOptimizedForSize {
 message TestRequiredOptimizedForSize {
 message TestRequiredOptimizedForSize {
   required int32 x = 1;
   required int32 x = 1;
 }
 }
- 
+
 message TestOptionalOptimizedForSize {
 message TestOptionalOptimizedForSize {
   optional TestRequiredOptimizedForSize o = 1;
   optional TestRequiredOptimizedForSize o = 1;
 }
 }

+ 1 - 1
java/compatibility_tests/v2.5.0/protos/src/proto/google/protobuf/unittest_optimize_for.proto

@@ -55,7 +55,7 @@ message TestOptimizedForSize {
 message TestRequiredOptimizedForSize {
 message TestRequiredOptimizedForSize {
   required int32 x = 1;
   required int32 x = 1;
 }
 }
- 
+
 message TestOptionalOptimizedForSize {
 message TestOptionalOptimizedForSize {
   optional TestRequiredOptimizedForSize o = 1;
   optional TestRequiredOptimizedForSize o = 1;
 }
 }

+ 3 - 3
java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/ByteStringTest.java

@@ -342,7 +342,7 @@ public class ByteStringTest extends TestCase {
       return -1;
       return -1;
     }
     }
   }
   }
-  
+
   // A stream which exposes the byte array passed into write(byte[], int, int).
   // A stream which exposes the byte array passed into write(byte[], int, int).
   private static class EvilOutputStream extends OutputStream {
   private static class EvilOutputStream extends OutputStream {
     public byte[] capturedArray = null;
     public byte[] capturedArray = null;
@@ -454,13 +454,13 @@ public class ByteStringTest extends TestCase {
           isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length));
           isArrayRange(bytes, byteString.toByteArray(), 0, bytes.length));
     }
     }
   }
   }
-  
+
   public void testNewOutputEmpty() throws IOException {
   public void testNewOutputEmpty() throws IOException {
     // Make sure newOutput() correctly builds empty byte strings
     // Make sure newOutput() correctly builds empty byte strings
     ByteString byteString = ByteString.newOutput().toByteString();
     ByteString byteString = ByteString.newOutput().toByteString();
     assertEquals(ByteString.EMPTY, byteString);
     assertEquals(ByteString.EMPTY, byteString);
   }
   }
-  
+
   public void testNewOutput_Mutating() throws IOException {
   public void testNewOutput_Mutating() throws IOException {
     Output os = ByteString.newOutput(5);
     Output os = ByteString.newOutput(5);
     os.write(new byte[] {1, 2, 3, 4, 5});
     os.write(new byte[] {1, 2, 3, 4, 5});

+ 6 - 6
java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DeprecatedFieldTest.java

@@ -39,22 +39,22 @@ import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Method;
 import java.lang.reflect.Method;
 /**
 /**
  * Test field deprecation
  * Test field deprecation
- * 
+ *
  * @author birdo@google.com (Roberto Scaramuzzi)
  * @author birdo@google.com (Roberto Scaramuzzi)
  */
  */
 public class DeprecatedFieldTest extends TestCase {
 public class DeprecatedFieldTest extends TestCase {
   private String[] deprecatedGetterNames = {
   private String[] deprecatedGetterNames = {
       "hasDeprecatedInt32",
       "hasDeprecatedInt32",
       "getDeprecatedInt32"};
       "getDeprecatedInt32"};
-  
+
   private String[] deprecatedBuilderGetterNames = {
   private String[] deprecatedBuilderGetterNames = {
       "hasDeprecatedInt32",
       "hasDeprecatedInt32",
       "getDeprecatedInt32",
       "getDeprecatedInt32",
       "clearDeprecatedInt32"};
       "clearDeprecatedInt32"};
-  
+
   private String[] deprecatedBuilderSetterNames = {
   private String[] deprecatedBuilderSetterNames = {
-      "setDeprecatedInt32"}; 
-  
+      "setDeprecatedInt32"};
+
   public void testDeprecatedField() throws Exception {
   public void testDeprecatedField() throws Exception {
     Class<?> deprecatedFields = TestDeprecatedFields.class;
     Class<?> deprecatedFields = TestDeprecatedFields.class;
     Class<?> deprecatedFieldsBuilder = TestDeprecatedFields.Builder.class;
     Class<?> deprecatedFieldsBuilder = TestDeprecatedFields.Builder.class;
@@ -74,7 +74,7 @@ public class DeprecatedFieldTest extends TestCase {
           isDeprecated(method));
           isDeprecated(method));
     }
     }
   }
   }
-  
+
   private boolean isDeprecated(AnnotatedElement annotated) {
   private boolean isDeprecated(AnnotatedElement annotated) {
     return annotated.isAnnotationPresent(Deprecated.class);
     return annotated.isAnnotationPresent(Deprecated.class);
   }
   }

+ 4 - 4
java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/DescriptorsTest.java

@@ -490,7 +490,7 @@ public class DescriptorsTest extends TestCase {
       .build();
       .build();
     // translate and crosslink
     // translate and crosslink
     FileDescriptor file =
     FileDescriptor file =
-      Descriptors.FileDescriptor.buildFrom(fileDescriptorProto, 
+      Descriptors.FileDescriptor.buildFrom(fileDescriptorProto,
           new FileDescriptor[0]);
           new FileDescriptor[0]);
     // verify resulting descriptors
     // verify resulting descriptors
     assertNotNull(file);
     assertNotNull(file);
@@ -511,7 +511,7 @@ public class DescriptorsTest extends TestCase {
     }
     }
     assertTrue(barFound);
     assertTrue(barFound);
   }
   }
-  
+
   public void testInvalidPublicDependency() throws Exception {
   public void testInvalidPublicDependency() throws Exception {
     FileDescriptorProto fooProto = FileDescriptorProto.newBuilder()
     FileDescriptorProto fooProto = FileDescriptorProto.newBuilder()
         .setName("foo.proto") .build();
         .setName("foo.proto") .build();
@@ -595,7 +595,7 @@ public class DescriptorsTest extends TestCase {
     Descriptors.FileDescriptor.buildFrom(
     Descriptors.FileDescriptor.buildFrom(
         fooProto, new FileDescriptor[] {forwardFile});
         fooProto, new FileDescriptor[] {forwardFile});
   }
   }
-  
+
   /**
   /**
    * Tests the translate/crosslink for an example with a more complex namespace
    * Tests the translate/crosslink for an example with a more complex namespace
    * referencing.
    * referencing.
@@ -644,6 +644,6 @@ public class DescriptorsTest extends TestCase {
       assertTrue(field.getEnumType().getFile().getName().equals("bar.proto"));
       assertTrue(field.getEnumType().getFile().getName().equals("bar.proto"));
       assertTrue(field.getEnumType().getFile().getPackage().equals(
       assertTrue(field.getEnumType().getFile().getPackage().equals(
           "a.b.c.d.bar.shared"));
           "a.b.c.d.bar.shared"));
-    }   
+    }
   }
   }
 }
 }

+ 1 - 1
java/compatibility_tests/v2.5.0/tests/src/main/java/com/google/protobuf/test/GeneratedMessageTest.java

@@ -901,7 +901,7 @@ public class GeneratedMessageTest extends TestCase {
     FieldDescriptor fieldDescriptor =
     FieldDescriptor fieldDescriptor =
         descriptor.findFieldByName("optional_nested_message");
         descriptor.findFieldByName("optional_nested_message");
 
 
-    // Before setting field, builder is initialized by default value. 
+    // Before setting field, builder is initialized by default value.
     TestAllTypes.Builder builder = TestAllTypes.newBuilder();
     TestAllTypes.Builder builder = TestAllTypes.newBuilder();
     NestedMessage.Builder fieldBuilder =
     NestedMessage.Builder fieldBuilder =
         (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor);
         (NestedMessage.Builder) builder.getFieldBuilder(fieldDescriptor);

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio