Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proto3 map support for C# #543

Merged
merged 8 commits into from Jun 26, 2015

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Jun 25, 2015

There are still some open questions about handling strings and ByteStrings, but this is a good first step.

More tests required. Generated code in next commit.
(Primarily this is starting the hash code of messages at a non-zero value...)
@jskeet
Copy link
Contributor Author

jskeet commented Jun 25, 2015

@jtattermusch @anandolee

@jskeet jskeet mentioned this pull request Jun 25, 2015
- 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
@jskeet
Copy link
Contributor Author

jskeet commented Jun 26, 2015

I've made the requested changes from #544 - I've added all the relevant tests I can think of, and the coverage looks pretty good... are there any other tests you'd like before I merge this?

(I haven't rebased the cleanup work yet - I'll do that when I merge this.)

@jskeet
Copy link
Contributor Author

jskeet commented Jun 26, 2015

Just found another bug with FieldCodec - will write significant tests for this before merging...

@jskeet
Copy link
Contributor Author

jskeet commented Jun 26, 2015

Okay, with the fix to FieldCodec (and some tests for it, finally :) I think I'm happy with this again.
@anandolee does my last comment around keeping the tests for testing make sense?

jskeet added a commit that referenced this pull request Jun 26, 2015
@jskeet jskeet merged commit 6b01539 into protocolbuffers:csharp-experimental Jun 26, 2015
@jskeet jskeet deleted the proto3-map branch June 29, 2015 19:48
@jtattermusch
Copy link
Contributor

I went through the code and LGTM (ex-post, because it's already been merged).

@jtattermusch jtattermusch mentioned this pull request Jul 16, 2015
taoso pushed a commit to taoso/protobuf that referenced this pull request Aug 1, 2018
)

Rework the handling of imported packages.

Do not add imported protobuf packages to a global registry. Instead,
maintain a per-file list of packages and names. This avoids imports
in one file affecting the generated code in a second one.

Consistently deal with imports in terms of import path, rather than
source file. This avoids imports of two .proto files in the same
Go package producing redundant import statements.

Introduce ImportPath and PackageName types to prevent confusion about
which values contain import paths ("github.com/golang/protobuf/proto")
and which contain package names ("proto").

Convert many uses of FileDescriptorProto to FileDescriptor, for
consistency and general convenience.
rinarakaki pushed a commit to rinarakaki/protobuf that referenced this pull request Aug 30, 2023
Fixes for google3 (layering check and formatting).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants