Commit Graph

986 Commits

Author SHA1 Message Date
Jan Tattermusch
f4ff22026b add a few more tests 2020-04-28 13:59:54 +02:00
Jan Tattermusch
9720ae41c2 adjust CustomOptionsTest.cs 2020-04-28 12:49:29 +02:00
Jan Tattermusch
944055a683 expose Options property on descriptors 2020-04-28 10:49:49 +02:00
Jan Tattermusch
7134d25eb8 Merge remote-tracking branch 'upstream/master' into protobuf_csharp_new_parsing 2020-04-27 13:18:07 +02:00
Jon Skeet
97737072f9 Add reflection support for proto3 optional fields
This is more involved than might be expected because the synthetic oneofs don't generate the properties we would usually expect to see.
2020-04-24 17:39:14 +01:00
Jon Skeet
bad9d753ae Add unit tests for proto3 optional fields
(This isn't as exhaustive as it might be, but the behavior is basically the same as proto2 optional fields.)
2020-04-24 17:39:14 +01:00
Jon Skeet
b0649a088a Regenerate C# code with the new generator, adding unittest_proto3_optional.proto
The changes in the existing proto2 code are solely around presence bits. The new generator allocated presence bits more efficiently. (Previously bits were sometimes allocated but never used.)
2020-04-24 17:39:14 +01:00
Jan Tattermusch
a1b9aa499e get rid of extraneous ParserInternalState.codedInputStream field 2020-04-23 16:58:59 +02:00
Jan Tattermusch
eb38a3cdb8 adjust some TODOs in ParsingPrimitives.cs 2020-04-22 10:03:51 +02:00
Jan Tattermusch
dd97af88db deduplicate ExtensionSet.TryMergeFieldFrom implementation, add test 2020-04-22 09:03:15 +02:00
Jan Tattermusch
cf49962c57 actually use ParsingPrimitives.ReadBytes and ReadString 2020-04-21 16:58:32 +02:00
Jan Tattermusch
d7c1fab00b add benchmarks for parsing string and bytes 2020-04-21 16:31:32 +02:00
Jan Tattermusch
556cb8dc4b remove unused internal method 2020-04-21 14:49:12 +02:00
Jan Tattermusch
7f42d7c65b increase MapField test coverage 2020-04-21 14:44:13 +02:00
Jan Tattermusch
7c74e3901b deduplicate MapField implementation 2020-04-21 14:32:15 +02:00
Jan Tattermusch
9ca70db2aa remove a few more TODOs 2020-04-16 13:24:42 +02:00
Jan Tattermusch
a171f6d670 address a few TODOs 2020-04-16 13:02:11 +02:00
Jan Tattermusch
373b9eaeb2 optimize ParseRawLittleEndian32 2020-04-15 18:28:18 +02:00
Jan Tattermusch
17ea4d932f add LegacyGeneratedCodeTest 2020-04-15 12:45:04 +02:00
Jan Tattermusch
f1d12ac768 also test with ParseContext in CodedInputStream test 2020-04-15 11:26:58 +02:00
Jan Tattermusch
9f00d3279b add missing assert to CodedInputStreamTest.AssertReadVarint 2020-04-15 10:41:12 +02:00
Jan Tattermusch
238fd35f1d improve test coverage 2020-04-15 10:08:19 +02:00
Joshua Haberman
74ad62759e Sync from Piper @306496510
PROTOBUF_SYNC_PIPER
2020-04-14 12:55:41 -07:00
Jan Tattermusch
b2d5ceb1f7 speedup parsing multi-segment readOnlySequence 2020-04-14 19:24:19 +02:00
Jan Tattermusch
a980705bdb attempt to fix CompatibilityTests 2020-04-14 18:16:18 +02:00
Jan Tattermusch
638a0813b4 increase coverage of GeneratedMessageTest 2020-04-14 18:04:47 +02:00
Jan Tattermusch
c2925d5b93 fix C# compatibility tests 2020-04-14 13:06:45 +02:00
Jan Tattermusch
0df7ddc805 regenerate 2020-04-14 12:47:32 +02:00
Jan Tattermusch
d7e2c8387a change MergeFrom_Internal to InternalMergeFrom 2020-04-14 12:47:32 +02:00
Jan Tattermusch
3936114642 remove newline 2020-04-14 10:44:55 +02:00
James Newton-King
18bfd9e2e5 Fix net45 tests 2020-04-14 10:37:30 +02:00
Jan Tattermusch
07182a843c optimize initialization of ParseContext 2020-04-14 09:37:59 +02:00
Jan Tattermusch
d17b5115d2 faster initialization of ParserInternalState 2020-04-14 09:37:59 +02:00
Jan Tattermusch
42eff9d640 ParseMessageBenchmark: parsing from ReadOnlySequence 2020-04-14 09:37:59 +02:00
Jan Tattermusch
5f836193c7 ParseRawPrimitivesBenchmark: compare CodedInputStream vs ParseContext 2020-04-14 09:37:59 +02:00
Jan Tattermusch
b2d2915439 make Google.Protobuf internals visible to benchmarks 2020-04-14 09:37:59 +02:00
Jan Tattermusch
3196ef9b5c regenerate C# protos 2020-04-14 09:37:59 +02:00
Jan Tattermusch
220e7be708 make things build after codegen change 2020-04-14 09:37:58 +02:00
Jan Tattermusch
6d5bc90d48 add ParseFrom(ReadOnlySequence) methods 2020-04-14 09:37:58 +02:00
Jan Tattermusch
ea605381e6 make everything build 2020-04-14 09:37:58 +02:00
Jan Tattermusch
175c96565f bring in new files 2020-04-14 09:37:57 +02:00
Jan Tattermusch
50e03cdde3
Merge pull request #7360 from jtattermusch/refactor_googlebenchmark
Refactor some Protobuf C# microbenchmarks
2020-04-13 17:34:22 +02:00
Jan Tattermusch
4116e65984 improve ParseMessageBenchmark maintainability 2020-04-07 11:56:37 +02:00
Joshua Haberman
503a2116aa Sync from Piper @305053102
PROTOBUF_SYNC_PIPER
2020-04-06 09:57:03 -07:00
Jan Tattermusch
79cfc73293 refactor WrapperBechmark 2020-04-06 18:24:13 +02:00
Jan Tattermusch
a2cbd5a824 serialization benchmark improvements 2020-04-06 17:32:50 +02:00
Joshua Haberman
c649397029
Set execute bit on files if and only if they begin with (#!). (#7347)
* Set execute bit on files if and only if they begin with (#!).

Git only tracks the 'x' (executable) bit on each file. Prior to this
CL, our files were a random mix of executable and non-executable.
This change imposes some order by making files executable if and only
if they have shebang (#!) lines at the beginning.

We don't have any executable binaries checked into the repo, so
we shouldn't need to worry about that case.

* Added fix_permissions.sh script to set +x iff a file begins with (#!).
2020-04-01 15:28:25 -07:00
Joshua Haberman
9c676d83ea Regenerated protos with ./generate_descriptor_proto.sh 2020-03-31 16:35:09 -07:00
Jan Tattermusch
f57ae5eac3
Merge pull request #7279 from jtattermusch/ParseRawPrimitivesBenchmark
Add benchmark for measuring raw primitive parsing speed
2020-03-12 19:11:39 +01:00
Jan Tattermusch
a0cc0e83cb
Remove unnecessary branch from ReadTag (#7289)
* Remove unnecesary branch from ReadTag

* address comments
2020-03-11 10:29:37 -07:00
Jan Tattermusch
447b6bbad8 address review comments 2020-03-11 07:08:46 -04:00
Jan Tattermusch
b90d3bd854 add benchmark for measuring raw primitive parsing speed 2020-03-05 12:09:11 +01:00
Sydney Acksman
d36d84c77b Add test for parsing using coded input 2020-02-23 16:08:13 -06:00
Sydney Acksman
ca123ec40e Swap registry from input when merging from existing input 2020-02-22 22:55:48 -06:00
Rafi Kamal
0eb476b696 Merge branch 3.11.x to master 2020-02-18 16:42:47 -08:00
Rafi Kamal
147fd0b710
Update Google.Protobuf.Tools.nuspec to remove 32-bit Mac protoc reference (#7227) 2020-02-18 10:23:20 -08:00
Rafi Kamal
1f2d6bf4b5
Remove 32-bit Mac binary from csharp build tools (#7215) 2020-02-14 12:50:45 -08:00
Jan Tattermusch
0e8f69e532
enforce recursion depth checking for unknown fields (#7210) 2020-02-14 10:17:06 -08:00
Rafi Kamal
c74057267d
Update protobuf version (#7206) 2020-02-12 14:41:16 -08:00
Jan Tattermusch
f20be83927 enforce recursion depth checking for unknown fields 2020-02-10 15:30:47 -08:00
Rafi Kamal
fedb2beee3
Merge pull request #6938 from ObsidianMinor/csharp/fix/6936 (#7188)
Fix latest ArgumentException for C# extensions

Co-authored-by: Jan Tattermusch <jtattermusch@users.noreply.github.com>
2020-02-10 10:46:19 -08:00
Rafi Kamal
345df38dd3
Update protobuf version (#7143) 2020-01-31 13:47:09 -08:00
Paul Yang
e8016753e3
Maven requires https connection (#7110) (#7114) 2020-01-22 12:29:56 -08:00
Paul Yang
39f4240856
Maven requires https connection (#7110) 2020-01-20 19:23:06 -08:00
Rafi Kamal
ed8688de72
Merge pull request #7064 from rafi-kamal/3.11.x-202001071136
Merge branch 3.11.x to master
2020-01-08 12:24:20 -08:00
Brian Wignall
a104dffcb6 Fix typos (#7050)
Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos, with https://github.com/bwignall/typochecker to help automate the checking.
2020-01-08 10:18:20 -08:00
Rafi Kamal
4500f31a6a Merge branch 3.11.x to master 2020-01-07 11:52:29 -08:00
Rafi Kamal
39492b68d8
Update protobuf version to 3.11.2 (#7004) 2019-12-10 17:50:28 -08:00
Jan Tattermusch
20b7fab0a9
Merge pull request #6674 from ObsidianMinor/csharp/general-cleanup
Cleanup various bits of Google.Protobuf
2019-12-05 10:38:10 +01:00
Jan Tattermusch
c8a56342d5
Merge pull request #6938 from ObsidianMinor/csharp/fix/6936
Fix latest ArgumentException for C# extensions
2019-12-05 10:36:47 +01:00
Sydney Acksman
367fd27732 Rename files and revert changes to generate protos script 2019-12-03 10:52:24 -06:00
Sydney Acksman
d5e964c8bb Make test comment a summary 2019-12-03 10:46:34 -06:00
Rafi Kamal
b78c53f935
Update protobuf version to 3.11.1 (#6972) 2019-12-02 11:57:21 -08:00
Sydney Acksman
34f9497162 Use explicit comparer for extension identifiers 2019-12-02 13:56:21 -06:00
Sydney Acksman
1a0ff9551a Add comment and Assert.DoesNotThrow to RequiredFieldsNoThrow 2019-12-02 13:50:51 -06:00
Sydney Acksman
145033c056 Adjust based on review feedback 2019-11-27 11:32:13 -06:00
Jan Tattermusch
058d5b0d71
Merge pull request #6910 from ObsidianMinor/csharp/conformance-failures
Fix conformance test failures for Google.Protobuf
2019-11-26 17:18:05 +01:00
Rafi Kamal
1d5375c621
Update protobuf version to 3.11.0 (#6943) 2019-11-25 15:12:00 -08:00
Jan Tattermusch
96e9ff3863 Revert "Revert "C# upgrade dotnet SDK (#6877)" (#6888)" (#6920)
This reverts commit f06800524f.
2019-11-25 11:29:47 -08:00
Sydney Acksman
cd11d5414f Improve test to make sure the extensions are actually loaded for CustomOptions 2019-11-24 14:56:35 -06:00
Sydney Acksman
2b0b838528 Add tests 2019-11-24 14:22:50 -06:00
Sydney Acksman
3c2a32a75f Use Distinct on depended extensions to filter duplicate extensions 2019-11-24 14:22:26 -06:00
Rafi Kamal
6220db4ec4
Update protobuf version (#6927) 2019-11-21 19:10:04 -08:00
Sydney Acksman
f084d622c2 Add test for not throwing on missing required 2019-11-20 11:54:20 -06:00
Sydney Acksman
6f09cc3a0c Fix readability. 2019-11-20 10:56:34 -06:00
Sydney Acksman
3457f88940 Fix formatting 2019-11-20 10:55:48 -06:00
Jan Tattermusch
77d33734cf
simpler fix 2019-11-20 12:48:49 +01:00
Sydney Acksman
71ac3e5c0e Fix exception message on unsupported request output format 2019-11-19 17:50:53 -06:00
Sydney Acksman
e2e70a8a42 Fix conformance test failures for Google.Protobuf 2019-11-19 17:50:46 -06:00
Rafi Kamal
cd7b27be38 Update protobuf version (#6898) 2019-11-19 15:32:13 -08:00
Sydney Acksman
71c492da3c Add some missing null-checks
Remove IsInitialized checks accidentally left in MessageParser
Simplify ExtensionCollection.CrossLink
2019-11-19 12:34:19 -06:00
Erik Mavrinac
7de09eb62a C#: Add ByteString.Memory alongside ByteString.Span to allow calling e.g. FileStream.WriteAsync() that requires ReadOnlyMemory<byte> 2019-11-18 16:41:57 -08:00
Rafi Kamal
3cc55d6167
Update protobuf version (#6898) 2019-11-15 17:44:10 -08:00
Jie Luo
f06800524f
Revert "C# upgrade dotnet SDK (#6877)" (#6888)
This reverts commit 0c8acb6c8d.
2019-11-14 09:49:59 -08:00
Jan Tattermusch
0c8acb6c8d C# upgrade dotnet SDK (#6877)
* upgrade dotnet SDK

* upgrade dotnet SDK version in global.json
2019-11-14 09:39:31 -08:00
Rafi Kamal
394f5c8c0f Whitelist newly added conformance test failures for Ruby, C#, and PHP 2019-11-12 13:38:58 -08:00
Rafi Kamal
58d4420e2d Down Integrate Internal Changes 2019-11-12 13:38:58 -08:00
Sydney Acksman
b84929f7fb Rename .CodeGen to .TestProtos in Makefile and script 2019-11-08 08:41:26 -06:00
Sydney Acksman
51fa766baa Fix typos
Bring .NET Framework target down to 4.5
Rename project in comment
2019-11-08 07:23:51 -06:00
Sydney Acksman
a70c796988 Add project to solution 2019-11-08 07:23:51 -06:00
Sydney Acksman
8da87c6202 Rename Google.Protobuf.Test.CodeGen to Google.Protobuf.Test.TestProtos 2019-11-08 07:23:51 -06:00
Sydney Acksman
2bb49712aa Add comment to summarize project
Set lang version to C# 3.0
Add .NET Standard 2.0 target
Fix partial diagnostic string since it requires C# 6
2019-11-08 07:23:50 -06:00
Sydney Acksman
63780dfb28 Rebase on master 2019-11-08 07:23:50 -06:00
Sydney Acksman
a85c4a3299 Move generated test code to a seperate lib 2019-11-08 07:23:50 -06:00
Sydney Acksman
c04a02774d Change _Extensions property to normal body rather than expression 2019-11-07 15:30:12 -06:00
Jan Tattermusch
0150f7f532
Merge pull request #6843 from chrisdunelm/csharp_wrapper_primitive_opts
C#: Optimize parsing of some primitive and wrapper types
2019-11-05 18:04:53 +01:00
Chris Bacon
d22eaded5c Remove unneeded exception methods 2019-11-05 11:39:31 +00:00
Chris Bacon
2ac8946ee3 Allow extra fields in wrapper messages, more tests. 2019-11-04 21:35:38 +00:00
Chris Bacon
e305e56cad C#: Optimize parsing of some primitive and wrapper types 2019-11-04 20:26:27 +00:00
Sydney Acksman
e119a432a8 Use 3 parameter Encoding.FromBytes for default string values 2019-11-04 12:31:28 -06:00
Jan Tattermusch
b8b1b6793f add regenerate C# protos 2019-11-04 18:21:22 +01:00
Jan Tattermusch
85a87ed3cb add benchmark for wrapper type parsing 2019-11-04 18:21:22 +01:00
Jan Tattermusch
c81bad1b04 add wrapper_benchmark_messages.proto 2019-11-04 18:21:22 +01:00
Jan Tattermusch
9417a310d3
Merge pull request #6824 from jskeet/fix-extensions
Fix reflection access when using old generated code
2019-11-04 14:12:06 +01:00
Jon Skeet
7282f29ced Avoid NullReferenceException when accessing CustomOptions
Even though the property is deprecated, it still shouldn't throw.
2019-10-30 11:59:09 +00:00
Jon Skeet
9b5fdb0938 Ignore incomplete extensions when building a FileDescriptor
FileDescriptor construction uses an extension registry including extensions from imports. If these were created using an older version of protoc, the FieldDescriptor.Extension property may be null; we ignore such extensions rather than failing.
2019-10-30 09:47:45 +00:00
Jon Skeet
7581fd5ea6 Tests for issue 6822
(The implementation to fix this is in the following commit.)
2019-10-30 09:46:24 +00:00
Jon Skeet
e613ba6980 Add braces around single-statement if/foreach 2019-10-30 09:45:00 +00:00
Jan Tattermusch
c08b7512cf
Merge pull request #6759 from ObsidianMinor/csharp/extension-length-checks
Add length checks to ExtensionCollection
2019-10-22 08:24:43 +02:00
Jan Tattermusch
2f7f670134
Merge pull request #6530 from prat0088/csharp-ensuresize
c# feature(RepeatedField): Capacity property to resize the internal array
2019-10-18 17:35:12 +02:00
Sydney Acksman
f50bc62feb Add length checks to ExtensionCollection 2019-10-11 20:23:07 -05:00
Rafi Kamal
2ed41359fe Update version to 3.11.0-RC0 2019-10-03 14:24:27 -07:00
Rafi Kamal
97c7c3fc97 Merge 3.10.x to master 2019-10-03 14:03:38 -07:00
Sydney Acksman
c54ff8d0dc Fix many proto2 C# doc comments 2019-09-19 04:39:40 -05:00
Jie Luo
2a4657971d
Update to 3.10.0-rc0 (#6660)
* Cherry pick changes on update_version.py #6643

* Update version to 3.10.0-rc-0

* Do not add rc0 to php packages.xml
2019-09-18 13:30:03 -07:00
Rafi Kamal
5021cd3419 Update protobuf version 2019-09-12 13:50:24 -07:00
Vperus
8e6141a63d [csharp] Fix typo 2019-09-11 10:36:00 -07:00
Rafi Kamal
56bf637221 Update protobuf version 2019-09-05 09:47:52 -07:00
Jan Tattermusch
e2f5da65ee C#: add System.Memory dependency for net45 too (#6317)
* introduce GOOGLE_PROTOBUF_SUPPORT_SYSTEM_MEMORY

* allow building net45 target on unix systems too

* add Span<> support on net45 as well
2019-09-03 10:17:21 -07:00
Sydney Acksman
4d5ae5b4a4 Use proto2 and proto3 in unknown field tests 2019-08-29 18:07:02 -05:00
Sydney Acksman
bdc6cd1d0b Expose Extension field in FieldDescriptor 2019-08-23 17:29:59 -05:00
Sydney Acksman
0436b8db85 GetOrRegisterExtension -> GetOrInitializeExtension
Add comment explaining IExtensionMessage instability
2019-08-23 17:29:59 -05:00
Sydney Acksman
c5fa0e08c7 Fix comment on IExtendableMessage.GetOrRegisterExtension 2019-08-23 17:29:59 -05:00
Sydney Acksman
79cf8a8bae Fix readability in FieldCodec.ForMessage/Group factories 2019-08-23 17:29:59 -05:00
Sydney Acksman
3237ad39f8 Rename ExtensionRegistry.Add(IEnumerable<Extension>) overload to AddRange 2019-08-23 17:29:58 -05:00
Sydney Acksman
930db675ca Revert changes for FieldPresenceAccessor 2019-08-23 17:29:58 -05:00
Sydney Acksman
29141f482c Fix default extension values being unused in FieldCodec 2019-08-23 17:29:58 -05:00
Sydney Acksman
47f2017cf3 Review changes
* Add Syntax enum and make file syntax checks check the enum
 * Made IsPacked a normal get method without ternary op
 * Moved IFieldAccessor.HasValue to IFieldPresenceAccessor
 * Change naming of GetIsExtensionsInitialized
 * Fixed stray text in summary text
2019-08-23 17:29:58 -05:00
Sydney Acksman
29d5186867 Regenerate testprotos.pb 2019-08-23 17:29:58 -05:00
Sydney Acksman
6b90ac13e0 Reorganize some tests 2019-08-23 17:16:37 -05:00
Sydney Acksman
bf4f6c5431 Make extension reflection helper use GetOrRegisterExtension 2019-08-23 17:16:37 -05:00
Sydney Acksman
9163a6f1ad Add tests for extension accessor 2019-08-23 17:16:37 -05:00
Sydney Acksman
0c80570a8b Add ExtensionSet tests and add checks that non-message extension fields don't fail initialization checks 2019-08-23 17:16:37 -05:00
Sydney Acksman
f4cfd2def3 Remove dead HasValue code for ExtensionValue and add null-checks to ExtensionSet.Set 2019-08-23 17:16:37 -05:00
Sydney Acksman
8dc69ede45 Remove unnecessary check in GetIsExtensionsInitialized 2019-08-23 17:16:37 -05:00
Sydney Acksman
b78330b21d Fix RepeatedExtensionValue.IsInitialized 2019-08-23 17:16:37 -05:00
Sydney Acksman
ebf0bfaed8 Add private "_Extensions" property to speed up IsInitialized checks 2019-08-23 17:16:37 -05:00
Sydney Acksman
134242bc46 Change input message to UnknownFieldSet tests to proto2 test message to test groups. 2019-08-23 17:16:37 -05:00
Sydney Acksman
cd65535423 Added group roundtrip tests and fixed any issues discovered 2019-08-23 17:16:37 -05:00
Sydney Acksman
011427c9d8 Fix issues from interactive rebase and regenerate code 2019-08-23 17:16:37 -05:00
Sydney Acksman
5b2f2c5292 file descriptors and the syntax field are really weird with proto2 2019-08-23 17:16:37 -05:00
Sydney Acksman
8e917d1688 Added FieldDescriptor.IsExtension and sealed ExtensionCollection 2019-08-23 17:16:37 -05:00
Sydney Acksman
8b7fb7d0f4 Add tests for field presence and default values
Adjust APIs for extensions to properly return default values for extensions
Fix issues with IsInitialized and proto2 field reflection
2019-08-23 17:16:36 -05:00
Sydney Acksman
a976158b1c Fix incorrect code gen for string fields with default values 2019-08-23 17:16:36 -05:00
Sydney Acksman
8a57ec847b Add test protos to test project
Fix generated group code missing end group tag case
Fix generated field classes searching for presence index for extensions
2019-08-23 17:16:36 -05:00
Sydney Acksman
6e7c43fc68 Add checks to make sure values retrieved from CustomOptions match extension values 2019-08-23 17:16:36 -05:00
Sydney Acksman
43619bb6b2 Uncomment option code in OneofDescriptor 2019-08-23 17:16:36 -05:00
ObsidianMinor
03872044b1 Make extension container classes public and modify conformance to test proto2 messages 2019-08-23 17:16:36 -05:00
Sydney Acksman
05712c6791 Reapply custom option accessors from previous PR along with CustomOptions accessor deprecations 2019-08-23 17:16:36 -05:00
Sydney Acksman
5caa44e056 Remove internal constraint on descriptor proto 2019-08-23 17:16:36 -05:00
Rafi Kamal
4f02f056b5 Down integrate to GitHub 2019-08-22 17:33:01 -07:00
Tristan Pratt
da5740082e c# feature(RepeatedField): Capacity property to resize the internal array
This property is useful for efficiently initializing long RepeatedFields.

I used System.Collections.Generic.List's design as a model.  It should feel the most familiar to C# developers.
2019-08-17 19:12:00 -04:00
Jie Luo
43156775be
Merge 3.9.x 201908071359 to master (#6484)
* Add changelog for 3.9.x

* Revert "Make php message class final to avoid mocking (#6277)" (#6324)

This reverts commit 7f84a94366.
This is just temporary. Eventually, we still want to roll forward this
change. Some users are complaining they need more time to clean up their
code.

* Update extract_includes.bat.in

File io_win32.h is not in directory google\protobuf\stubs under directory google\protobuf\io

* Set oneof case in array constructor (#6351)

Forgot to set it previously.

* Update protobuf version (#6366)

* Drop building wheel for python 3.4 (#6406)

https://github.com/matthew-brett/multibuild/pull/240

* Fix binary compatibility in FieldCodec factory methods (#6380) (#6424)

* Fix binary compatibility in FieldCodec factory messages

* Make default value parameter for current factories required

* Route old methods through default value overloads

* Remove ExtensionRegistry.Add(params) overload

* Rename ExtensionRegistry.Add(IEnumerable<Extension>) overload to AddRange

* Edit naming of parameters in Extension classes

* * Fix add API warnings to docs for extension APIs
* Rename internal ExtensionSet.GetValue to TryGetValue

* Disable javadoc error (#6371)

* Disable javadoc error

Actual fixes of the javadoc will be followed up

* Remove duplicated configuration

* Update javadoc plugin version

* Updated Bazel test script to use most recent Bazel version (#6413) (#6433)

I'm not exactly sure why, but this fixes the failing Bazel presubmit
test. Using the most recent version seems like a good idea anyway so
that we can make sure we're compatible with any new Bazel changes.

* [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl

* No need to update version in generated code (#6471)

generate_descriptor will handle that

* Update protobuf version (#6472)
2019-08-09 13:21:18 -07:00
Jie Luo
d1eeb852fc
compatibility test between last released and current for java python php (#6441)
* compatibility tests between last released and the current version
2019-07-31 17:49:26 -07:00
Jie Luo
e399308ef0 Add csharp compatibility tests between last released and the current version (#6407)
* Add csharp compatibility tests for 3.7.0

* Add compatibility test between last major version with current for C#

* Update last version number

* compatibility tests between last released and the current version

* fix typo
2019-07-25 14:31:00 -07:00
Sydney Acksman
9857d636fd Fix binary compatibility in FieldCodec factory methods (#6380)
* Fix binary compatibility in FieldCodec factory messages

* Make default value parameter for current factories required

* Route old methods through default value overloads
2019-07-19 16:25:00 -07:00
Paul Yang
7bff8393ca
Down Integrate to GitHub (#6414)
* Down integrate to GitHub

* Fix broken tests
2019-07-19 14:49:01 -07:00
Hao Nguyen
ef5e8f4aa7 Update C# generated proto file 2019-06-17 14:05:40 -07:00
Hao Nguyen
638720274b Update version to 3.9.0 2019-06-17 09:34:50 -07:00
Hao Nguyen
bb1c0adedf Remove unused fields 2019-06-12 12:32:51 -07:00
Hao Nguyen
634d704d23 Merge branch '3.8.x' into 3.8.x-201905311515 2019-05-31 15:18:39 -07:00
Hao Nguyen
582927ae2a Update generated files 2019-05-21 16:42:33 -07:00
Hao Nguyen
b0d648664d Update protobuf version 2019-05-21 14:07:13 -07:00
Hao Nguyen
2352a30e66 Revert "Update protobuf version"
This reverts commit 6d96493b31.
2019-05-21 13:49:06 -07:00
Hao Nguyen
6d96493b31 Update protobuf version 2019-05-21 13:31:01 -07:00
Sydney Acksman
9e89b6e70a C# Proto2 feature : Extensions (#5350)
* Compiler changes (extensions)

* Generated changes (extensions)

* Library changes (extensions)

* Adjusted a summary to indicate ContainingType can be null for extensions

* Compiler changes (custom option review + access level review)

* Generated code changes (custom options + access review)

* Library changes (custom options + access review)

* Support C# 6 with library changes

* Access HasValue by property

* Set access level of all extension classes to internal (revert in next PR)

* Added null checks to custom options

* Rebase on master and regenerate Conformance

* Removed second dictionary from ExtensionSet

* Rebased compiler changes

* Rebased generated code changes

* Rebased library changes + review changes

* Add more safety checks to extension accessors

* Remove instances where extension sets were unnecessarily allocated

* Remove cleared items from sets
Empty sets are now made null
IExtensionMessage -> IExtendableMessage

* Remove dead code from IExtensionValue impls

* Clean both repeated and single value extensions

* Add GetOrRegister method for repeated fields and allow clearing repeated extensions

* Add type safe ClearExtension methods, remove non-generic IExtendableMessage interface.

* Simplify ExtensionSet.TryMergeFieldFrom

* Rebase on master to resolve conflicts

* Fix Makefile.am

* Add ObjectIntPair to Makefile.am
2019-05-03 13:54:41 -07:00
Hao Nguyen
37a89f8e1a Update version to 3.8.0 2019-04-23 16:14:52 -07:00
Hao Nguyen
3d69bad4b2 Update generated proto and remove a test from failure_list 2019-04-10 13:33:56 -07:00
Hao Nguyen
ef1e8e7172 Add module for JavaLite and fix builds 2019-04-09 06:48:01 -07:00
Adam Cozzette
8645d893ab Merge branch '3.7.x' into merge-3-7-x 2019-03-26 14:32:20 -07:00
Paul Yang
6973c3a504
Update version number to 3.7.1 (#5947)
* Update version number to 3.7.1

* Update version number in port_def.inc
2019-03-26 09:30:12 -07:00
Hao Nguyen
71f2996d7c Update generated descriptor files 2019-03-20 15:39:36 -07:00
Jan Tattermusch
ec3d94819d add System.Memory dependency (#5835)
also add useful Span-based methods for ByteString
2019-03-18 16:28:02 -07:00
Jon Skeet
2de68bc33a Make the C# benchmarks non-packable 2019-03-15 09:39:50 +00:00
Jan Tattermusch
f071c9e0f3 fix source stepping by upgrading sourcelink (#5891) 2019-03-14 14:58:35 -07:00
Jon Skeet
233f4865ee First pass at benchmarking for C# 2019-03-13 15:26:57 +00:00
Paul Yang
4b145b1c7f
Parse nested listvalue in json for ruby (#5867)
* Add conformance test for nested listvalue

* Fix upb for parsing repeated Value/ListValue

* Add failed repeated ListValue conformance test into php failure list
2019-03-12 10:56:58 -07:00
Jan Tattermusch
60a889e048 make check for distinct hashcode optional 2019-03-12 08:56:32 -04:00
Jan Tattermusch
e6a22c9777 test all frameworks on windows 2019-03-12 05:17:13 -04:00
Jan Tattermusch
753daae027 use netcoreapp2.1 for testing 2019-03-12 05:16:52 -04:00
Jan Tattermusch
79c32b17ac add scripts for C# windows tests 2019-03-12 05:16:52 -04:00
Sydney Acksman
15fab9109d Bump target frameworks of C# programs from netcoreapp1.0 to netcoreapp2.1 (#5838)
* Bump target frameworks from netcoreapp1.0 to netcoreapp2.2.
Move global.json up to root of repo, change SDK ver to 2.2.100
Change .net core sdk in dockerfile for kokoro to ver 2.2.100

* Re-add curl install

* Change all exe target to 2.1

* Fix incorrect versions in global.json and Dockerfile

* Downgrade version to 2.1 to match exe targets

* introduce separate testing Dockerfile for C#

* revert changes to the shared Dockerfile

* use netcoreapp2.1 for C# conformance tests

* use language specific dockerfile for testing C#

* Edit compatibility tests script to use parameters instead of file copies

* install dotnet SDK on windows before running the tests

* update csharp_EXTRA_DIST
2019-03-11 13:03:58 -07:00
WilliamWhispell
59284450fa Use fixed size for bool, float and double field in codec (#5810)
* Improve C# serialization performance of repeated fields for primitives.

* Changes based on feedback.

* Change compatibility tests to chec float, bool and double are fixed

* Changes based on feedback.

* In the compute methods use the newly created constants
2019-03-08 14:35:21 -08:00
Bo Yang
cb6fa92ee8 Merge branch '3.7.x' 2019-03-04 10:18:18 -08:00
Paul Yang
582743bf40
Update version number to 3.7.0 (#5793)
* Update version number to 3.7.0

* Add php/releash.sh to Makefile.am

* Make cpp_distcheck exit on fail
2019-02-28 12:55:14 -08:00
Paul Yang
bf32b36ab8
Merge pull request #5765 from BSBandme/integration
down integration from internal
2019-02-26 22:11:08 -08:00
Sydney Acksman
a4c3472ce8 Add some exceptions for MessageParser.ParseFrom (#5588)
* Fix #5513

* Added tests for invalid lengths when reading strings and bytes.
Added test for reading tags with invalid wire types in unknown field set.
Changed invalid length check in ReadString to match the one in ReadBytes
2019-02-26 15:31:29 -08:00
Yilun Chong
6d29c22a43 fix conformance test for text format 2019-02-26 13:46:30 -08:00
Yilun Chong
af8b91b828 fix csharp by regenerate descriptor 2019-02-26 13:07:59 -08:00
Yilun Chong
e4e5bc49d7
Fix failure test by regenerating descriptor and revert golden file (#5762) 2019-02-24 17:09:49 -08:00
Bo Yang
b52754b719 Update version to 3.7.0rc3 2019-02-22 11:31:48 -08:00
Xiang Dai
e479410564 delete all duplicate empty blanks (#5758)
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-20 19:28:50 -08:00
Paul Yang
c7b3392201
Update version to 3.7.0 (#5749)
* Update version to 3.7.0

* Update version number for java bom
2019-02-19 15:54:45 -08:00
Sydney Acksman
e7283254d6 Change MessageType != null in IsInitialized to FieldType == Message || Group (#5688) 2019-02-14 11:34:15 -08:00
Sydney Acksman
dbf77c65c4 Refactor how group endings are detected in generated C# code (#5686)
* Modify how end tags are encounted in merge code (compiler)

* Modify how end tags are encounted in merge code (generated)

* Modify how end tags are encounted in merge code (library)

* Regenerate generated code through generate_descriptor_proto.sh
2019-02-11 15:14:43 -08:00
Sydney Acksman
2a05691a53 Refactor how group endings are detected in generated C# code (#5686)
* Modify how end tags are encounted in merge code (compiler)

* Modify how end tags are encounted in merge code (generated)

* Modify how end tags are encounted in merge code (library)

* Regenerate generated code through generate_descriptor_proto.sh
2019-02-11 15:12:40 -08:00
Adam Cozzette
1ee15baefc Updated version to 3.7.0rc2 2019-01-30 21:08:04 -08:00
Hao Nguyen
d5be2baa46 Update version to 3.7.0 2019-01-24 10:23:02 -08:00
Yilun Chong
a2a0afb546
Down-integrate internal changes to github. (#5575)
* Down-integrate internal changes to github.

* Fix BUILD file and regenerate csharp descritpor
2019-01-13 17:40:58 -08:00
Yilun Chong
cb95a7f6a8
Down-integrate internal changes to github. (#5566)
* Down-integrate internal changes to github.

* fix csharp conformance test

* add comments in conformance.proto for text format

* fix comments

* fix comments, re-generated csharp file

* fix comments, re-generated csharp file
2019-01-11 11:40:52 -08:00
Thomas Van Lenten
b1b9eaa6c7 Comments on the next line will go to the next field.
Even though the comments were indented to appear to go with the jspb
case/field, protoc doesn't collect comments like that, so these "hanging"
comments actually "attach" to the next thing added to each.  Looking at
https://github.com/protocolbuffers/protobuf/pull/5566 you see where
the generated code picked up the comment on the wrong field.
2019-01-10 13:14:21 -05:00
Yilun Chong
0adb74c2d3 Down-integrate internal changes to github. (#5555)
* Down-integrate internal changes to github.

* fix python conformance test

* fix csharp conformance test

* add back java map_lite_test.proto's optimize for option

* fix php conformance test
2019-01-08 15:06:30 -08:00
Bo Yang
624a40a387 Down-integrate internal changes to github. 2018-12-20 14:21:20 -08:00
Paul Yang
cecba296b8
Down-integrate internal changes (#5467)
* Down-integrate internal changes

* Update generated code for php, objc and csharp.

* Add missing dependency in conformance_php
2018-12-14 16:05:03 -08:00
Hao Nguyen
4b02f652e0 Make sure to add a new line at the end of XML files 2018-12-14 15:10:11 -08:00
Hao Nguyen
9349e23827 Replace update_version shell script with a python script, which is much better at handling XML rewrite. Update the PHP version too. As part of rewrite, some XML file format will change a little, but the semantics is still the same so it should be okay. 2018-12-14 15:05:48 -08:00
Hao Nguyen
db0a9e0b96 Add <LangVersion>6</LangVersion> to the core protobuf C# project to prevent future incompatibility 2018-12-10 15:21:01 -08:00
Hao Nguyen
3d207c33a4 Fix TimestampPartial operator == overload implementation: Cannot call == inside it, otherwise it would cause stack overflow 2018-12-10 13:41:15 -08:00
Hao Nguyen
24638088c6 Make Protobuf compatible with C# 6 2018-12-10 10:22:41 -08:00
Jon Skeet
627cc48f5a Increase C# default recursion limit to 100 (#5339)
* Increase C# default recursion limit to 100

This matches the Java and C++ defaults.

* Change compatibility tests to use execution-time default recursion limit

This way the same tests should pass against all versions, even
if the recursion limit changes. (The tests will be testing whether
different messages work, admittedly - but that's probably fine.)
2018-11-13 10:21:30 -08:00
Adam Cozzette
86d4fe47df Updated checked-in generated code 2018-11-09 11:35:34 -08:00
Sydney Acksman
6f73c50936 C# Proto2 feature : Groups (#5183)
Add group support for proto2
2018-11-05 13:37:08 -08:00
Benjamin Krämer
80e530dabf Ported FieldMaskUtil from Java to C# (#5045)
* Ported FieldMaskUtil from Java to C#

* Merged FieldMaskUtil into FieldMaskPartial

- Removed FieldMaskUtil
- Moved FieldMaskTree to root
- Updated tests

* Improved tests

- Removed internal method FieldMaskTree.GetFieldPaths
- Proof FieldMask.Paths only contains expected values

* Added FieldMaskTreeTest to Makefile

* Added FieldMaskTree to Makefile
2018-10-08 12:54:05 -07:00
Sydney Acksman
3f826a6dbf Add method for Any.Is (#5207) 2018-10-05 11:06:58 -07:00
Adam Cozzette
4426cb5733
Merge pull request #5172 from shields/smear-comments
Smear comments
2018-09-24 13:52:52 -07:00
Sydney Acksman
54176b26a9 C# Proto2 feature : Field presence and default values (#4642)
* Compiler changes

* Generated code changes

* Library changes

* Compiler style changes

* Generated style changes

* Fix Windows build errors

* Implement changes from review

* Reintroduce proto2 check

* Compiler changes (required handling review)

* Generated code changes (required handling review)

* Library changes (required handling review

* Field presence rewrite (compiler changes)

* Field presence rewrite (generated code changes)

* Compiler comment

* IFieldAccessor.HasValue library implementation

* Remove Clear methods and default values from proto3 code (Compiler)

* Remove Clear methods and default values from proto3 code (Generated)

* Remove Clear methods and default values from proto3 code (Library)

* Fix distcheck error

* Rewrite default string values to use base64 and convert

* Library changes (IMessage2)

* Compiler changes (IMessage2)

* Generated changes (IMessage2)

* Rebased and regenerated

* Compiler changes (initialized extension)

* Generated changes (initialized extension)

* Library changes (initialized extension)

* Refactor MessageExtensions.IsRequired

* Move string default value creator and bytes default value creator back to seperate methods

* Dead code cleanup

* Fixed segmentation fault
Removed unused header method declarations
2018-09-24 13:42:24 -07:00
Jon Skeet
47d33e752e Test locations, and add comment to clarify testing 2018-09-22 09:09:15 +01:00
Jon Skeet
6e39eaad3c Add more detailed comments for declaration properties 2018-09-22 09:09:15 +01:00
Jon Skeet
1376ee4e6a Simplify descriptor tests
Rather than converting the proto to a ByteString again, use the
existing SerializedData property.
2018-09-22 09:09:15 +01:00
Jon Skeet
988b381c83 Add comment about FileDescriptor not exposing a declaration 2018-09-22 09:09:15 +01:00
Jon Skeet
1711999078 Provide simple access to descriptor declarations in C#
This is primarily for access to comments, which would be expected to be available in a protoc plugin.

The implementation has two fiddly aspects:

- We use a Lazy<T> to avoid building the map before cross-linking. An alternative would be to crosslink at the end of the constructor, and remove the calls to CrossLink elsewhere. This would be generally better IMO, but deviate from the Java code.
- The casts to IReadOnlyList<DescriptorBase> are unfortunate. They'll always work, because these lists are always ReadOnlyCollection<T> for a descriptor type... but we can't use IList<DescriptorBase> as that's not covariant, and it's annoyingly fiddly to change the field to be of type ReadOnlyCollection<T>.
2018-09-22 09:09:15 +01:00
Michael Shields
10360e342f Regenerate C# and Objective-C. 2018-09-19 12:54:57 -07:00
Jon Skeet
baa4a21130 Cross-link descriptor when building from byte strings
This performs more testing for field descriptors built from byte
strings too, but that's mostly incidental. The chief intent is to
check that cross-linking occurs.
2018-09-10 22:00:36 +01:00
Josh Haberman
c73d689c95 Regenerated C# protos. 2018-09-04 11:49:04 -07:00
Feng Xiao
afe98de32a Replace repo links. 2018-08-22 11:55:30 -07:00
Jon Skeet
228530e2da Support creating FileDescriptors dynamically from binary data.
Related to #658 and #5007.
2018-08-20 22:00:02 +01:00
Feng Xiao
a4862e790e Update generated descriptors. 2018-08-08 17:21:04 -07:00
Adam Cozzette
94d55e5292 Merge branch '3.6.x' into merge-3-6-x 2018-08-01 13:44:55 -07:00
Adam Cozzette
9e1286b949 Updated version numbers to 3.6.1 2018-07-27 13:30:28 -07:00
Paul Yang
8705adc228
Give a specific category to each test. (#4965)
* Give a unique category to each test.

This change introduce a TestCategory enum to ConformanceRequest. Existing tests
are divided into three categories: binary format test, json format test and json
format (ignore unknown when parsing) test. For the previous two categories, there
is no change to existing testee programs. For tests with the last category, testee programs
should either enable ignoring unknown field during json parsing or skip the test.

* Fix python test

* Fix java

* Fix csharp

* Update document

* Update csharp generated code
2018-07-27 12:24:42 -07:00
Jan Tattermusch
f50be7de91 Fix C# nuget build on Kokoro (#4912)
* upgrade dotnet SDK to 2.1.3 on kokoro linux
2018-07-18 11:04:59 -07:00
Paul Yang
26eeec93e4
Enable ignoring unknown in json parsing in php (#4839)
* Enable ignoring unknown in json parsing in php

* Update generated descriptor files

* Update failure list for other languages.

* Remove unnecessary php files
2018-07-09 14:29:23 -07:00
Warren Falk
96833b8f4b implement IComparable and comparison operators on Timestamp (#4318) 2018-07-09 14:26:36 -07:00
Adam Cozzette
d6f346b4d5
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
2018-06-25 15:52:29 -07:00
Sydney Acksman
3d603f481e Remove protoc conditional properties (#4817)
* Remove protoc conditional properties

* Fix duplicate brace
2018-06-25 15:21:30 -07:00
Adam Cozzette
82d3d7d250 Merge branch '3.6.x' into merge-3-6-x 2018-06-25 13:22:10 -07:00
Sebastian Schuberth
ee03556df9 Remove the executable bit from several source code files
This potentially avoids compiler warnings.
2018-06-25 08:17:39 +02:00
Sydney Acksman
1f77342b78 Add msbuild targets to C# tools for protoc compilers (#4648)
* Added props to C# tools

* Add targets file to makefile.am
2018-06-21 14:53:31 -07:00
Adam Cozzette
9d64d740a1 Removed duplicate using statement from ReflectionUtil.cs 2018-05-29 14:29:59 -07:00
Jisi Liu
45eb28b588 Update version number to 3.6.0 2018-05-14 16:06:22 -07:00