Commit Graph

2548 Commits

Author SHA1 Message Date
Jan Tattermusch
cacbedf04e export c# naming routines publicly 2015-07-10 13:40:34 -07:00
Jon Skeet
6ea9bc7aa3 Fixes to JsonFormatter
- Handle oneof properly
- Omit unknown enum values
2015-07-10 14:05:52 +01:00
Jon Skeet
68fc689e52 Generated code changes for previous submit 2015-07-10 14:05:17 +01:00
Jon Skeet
ef3464dff6 Oneof reflection support. (Generated code changes in next commit.) 2015-07-10 14:04:53 +01:00
Jon Skeet
5b9288e47d Use the new JsonFormatter to implement ToString on generated messages. 2015-07-10 11:42:56 +01:00
Jon Skeet
f8c151f21e Initial implementation of JSON formatting
- No parsing
- Reflection based, so not hugely efficient
- No line breaks or indentation
2015-07-10 11:42:56 +01:00
Jon Skeet
94878b3080 Merge pull request #566 from jskeet/csharp-reflection
Improve C# reflection support
2015-07-10 09:08:44 +01:00
Paul Yang
fe50044041 Merge pull request #570 from google/internal-third-party
Internal local modifications.
2015-07-09 15:13:12 -07:00
Bo Yang
9f563bd0d8 Internal local modifications. 2015-07-09 12:39:52 -07:00
Jan Tattermusch
db552c9297 Merge pull request #577 from jskeet/csharp-fixup
Fix-ups suggested in PR #560
2015-07-09 12:25:04 -07:00
Jon Skeet
0da4a89c97 Knock-on effects of moving GetSampleMessage. 2015-07-09 08:26:07 +01:00
Jon Skeet
14f2222a50 Lots more tests for FieldCodec, MapField, RepeatedField
... and some implementation changes to go with them.
2015-07-09 08:26:07 +01:00
Jon Skeet
af259b77bf Fix descriptor reflection in various ways
- The protos are no longer publicly exposed at all
- Oneof detection now works (as we default to -1, not 0)
- OneofDescriptor exposes the fields in the oneof
- Removed unnecessary code for replacing protos - remnant of extensions
- There's now just the non-generic form of IDescriptor
2015-07-09 08:26:06 +01:00
Jon Skeet
5350822b0a Regenerated code due to previous commit.
Note that now we need a proto3 version of addressbook.proto. This may affect other platforms, and could do with an overhaul to follow proto3 conventions anyway (e.g. repeated field names). Will need to think about that carefully before merging into master. Raised issue #565 for this.
2015-07-09 08:26:05 +01:00
Jon Skeet
493e3db985 Codegen changes to support descriptor runtime changes
- Add a partial method called by all constructors
- Generate internal classes for descriptor.proto (only)
- Forbid proto2 descriptors except for descriptor.proto
2015-07-09 08:26:04 +01:00
Jon Skeet
462d569ec0 Changes to generated code due to previous commit. 2015-07-09 08:24:50 +01:00
Jon Skeet
78ea98f56f Implement reflection properly for fields.
- FieldAccessorTable is now non-generic
- We don't have a static field per message type in the umbrella class. (Message descriptors are accessed via the file descriptor.)
- Removed the "descriptor assigner" complication from the descriptor fixup; without extensions, we don't need it
- MapField implements IDictionary (more tests would be good...)
- RepeatedField implements IList (more tests would be good)
- Use expression trees to build accessors. (Will need to test this on various platforms... probably need a fallback strategy just using reflection directly.)
- Added FieldDescriptor.IsMap
- Added tests for reflection with generated messages

Changes to generated code coming in next commit.
2015-07-09 08:24:49 +01:00
Jon Skeet
3805b43009 Merge branch 'csharp-remove-extensions' into csharp-fixup 2015-07-09 08:24:25 +01:00
Jon Skeet
3cce11ce1c Minor fix-ups as suggested in PR #560.
- Added new line at the end of SampleEnum
- Moved GeneratedMessageTest.GetSampleMessage to a new class, SampleMessages, and renamed it to CreateFullTestAllTypes.
2015-07-09 08:12:44 +01:00
Jon Skeet
a249bbc9e6 Merge pull request #561 from jskeet/csharp-copyright
Fix C# copyright statements
2015-07-09 07:54:10 +01:00
Jon Skeet
4ae9b6c0d1 Merge pull request #560 from jskeet/csharp-repeated
Large changes to repeated field handling
2015-07-09 07:53:04 +01:00
Joshua Haberman
5a020d41a5 Merge pull request #575 from haberman/rbleak
Worked around memory leak bug in Ruby interpreter.
2015-07-08 17:28:32 -07:00
Josh Haberman
8c717ad530 Worked around memory leak bug in Ruby interpreter.
Change-Id: I8e2b425f9008e6b82d41d59783bb8b04af1f886f
Fixes: https://github.com/google/protobuf/issues/474.
2015-07-08 14:14:58 -07:00
Paul Yang
ab2094de11 Merge pull request #554 from jcanizales/proto-objc-bazel
Add Bazel target for the Objective-C protobuf runtime
2015-07-06 13:05:46 -07:00
Jorge Canizales
d5d7bb3bfb Add Bazel target for protobuf ObjC runtime
Also add WKT headers to the umbrella file, and simplify Podspec with it.
Plus some layout improvements to the BUILD file.
2015-07-06 11:17:39 -07:00
Paul Yang
0a27430bd4 Merge pull request #500 from TeBoring/temp
Implement parsing for proto3 primitive repeated fields.
2015-07-01 14:35:19 -07:00
Feng Xiao
ec7bbc76be Merge pull request #551 from ostrovsky/master
MinGW64+MSYS2 compilation issues
2015-07-01 10:36:30 -07:00
Karol Ostrovsky
ee35402244 MinGW64+MSYS2 compilation issues and portable isnan using MathLimits 2015-07-01 10:09:41 +02:00
Paul Yang
eb162dad5f Merge pull request #458 from xfxyjwf/memory_leak
Delete default UnknownFieldSet when shuting down.
2015-06-30 16:45:22 -07:00
Feng Xiao
c3cb53b8f4 Merge pull request #556 from mgiuca/fix-clang-warning
Fix "sometimes-uninitialized" warning on Windows Clang.
2015-06-30 11:45:41 -07:00
Jon Skeet
38d8d3948a Remove unused code in C# codegen 2015-06-30 18:43:57 +01:00
Jon Skeet
ee835a3fe4 Fix copyright lines for all C# code.
Everything should now be consistent - the only difference between files is the year (aside from generated files).

Fixes issue #531.
2015-06-30 17:22:26 +01:00
Jon Skeet
f34d37a3d4 Tidying up and extra tests.
This is mostly just making things internal instead of public, removing and reordering a bunch of code in CodedInputStream/CodedOutputStream, and generally tidying up.
2015-06-30 13:20:31 +01:00
Jon Skeet
b9d1d3891f Tests changed enough to build 2015-06-30 13:20:30 +01:00
Jon Skeet
f2a27cc2c7 First pass (not yet compiling) at removing all the array handling code from Coded*Stream.
Prod code works, but some tests are broken. Obviously those need fixing, then more tests,
and review benchmarks.
2015-06-30 13:20:30 +01:00
Matt Giuca
43dcbbfec7 Fix "sometimes-uninitialized" warning on Windows Clang. 2015-06-30 17:23:26 +10:00
Jon Skeet
241e17ba78 Merge pull request #550 from jskeet/issue307
Fix for doubly-nested types - issue #307.
2015-06-29 20:43:26 +01:00
Jon Skeet
8d83f8d13e Fix for doubly-nested types - issue #307.
No specific test case - if the generated code compiles, the issue is fixed :)
2015-06-29 09:27:54 +01:00
Jon Skeet
b08b6bf62e Merge pull request #544 from jskeet/csharp-cleanup
Clean up C# code
2015-06-28 21:53:16 +01:00
Jon Skeet
6b01539dfc Merge pull request #543 from jskeet/proto3-map
Proto3 map support for C#
2015-06-26 20:47:35 +01:00
Jon Skeet
fb77cc9d9f More cleanup, based around searches for "Google.ProtocolBuffers"
- Remove some old proto2-based C#-only messages
- Remove the "build" directory which only contained out-of-date files
- Remove the csharp_namespace option from proto2 messages
- Change "Google.ProtocolBuffers" to "Google.Protobuf" in other messages
2015-06-26 20:13:07 +01:00
Jon Skeet
aa5104143c Remove a lot of code which wasn't needed any more. 2015-06-26 20:13:06 +01:00
Jon Skeet
e75a10d8ff Fix or delete old projects.
ProtoDump isn't currently useful, but will be when ToString emits JSON: fixed.
ProtoBench: deleted; we should reinstate when there's a common proto3 benchmark.
ProtoMunge: delete; not useful enough to merit fixing up.

Removed the [TestFixture] from ByteStringTest as Travis uses a recent enough version of NUnit.
2015-06-26 20:13:05 +01:00
Jon Skeet
286edc0fc2 Tests for FieldCodec, along with a fix. 2015-06-26 20:11:34 +01:00
Jon Skeet
e6fc9778f5 Generated code changes for previous commit. 2015-06-26 10:32:50 +01:00
Jon Skeet
c12833104f Tweaks and more tests for maps
- Change the default message hash code to 1 to be consistent with other code
- Change the empty list/map hash code to 0 as "empty map" is equivalent to "no map"
- Removed map fields from unittest_proto3.proto
- Created map_unittest_proto3.proto which is like map_unittest.proto but proto3-only
- Fixed factory methods in FieldCodec highlighted by using all field types :)
- Added tests for map serialization:
  - Extra fields within entries
  - Entries with value then key
  - Non-contiguous entries for the same map
  - Multiple entries for the same key

Changes to generated code coming in next commit
2015-06-26 10:32:23 +01:00
Jon Skeet
c06226354d Make map test keys even more different to avoid odd hash collisions 2015-06-25 13:45:53 +01:00
Jon Skeet
3e7d70cb69 Generated code changes due to map changes.
(Primarily this is starting the hash code of messages at a non-zero value...)
2015-06-25 12:08:55 +01:00
Jon Skeet
df44ae4413 More map tests, and various production code improvements.
Generated code in next commit.
2015-06-25 12:08:18 +01:00
Jon Skeet
68a4ee267f Merge pull request #534 from jskeet/proto3-freeze
Implement Freeze in C# protos
2015-06-25 10:03:48 +01:00