-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Ported FieldMaskUtil from Java to C# #5045
Ported FieldMaskUtil from Java to C# #5045
Conversation
Thanks for putting this together! Note that we are not so happy about the name "FieldMaskUtil" in Java and have a plan to rename it to "FieldMasks". I would recommend against using the name "FieldMaksUtil" in C# just because Java did. |
@xfxyjwf Thanks for the feedback. Would you prefer to include the FieldMaskTree in FieldMaskPartial (separate partial class), or maybe putting it in the root like JsonFormatter and other helper classes? I think it may be better to only have the stuff directly in FieldMasks and dropping the FieldMaskUtil class completely. |
Can we remove FieldMaskUtil. I noticed FieldMaskPartial has most APIs except IsValid. FieldMaskPartial and FieldMaskUtil are kind of duplicated |
I plan to do so, was just waiting on a response to my question. Would you prefer having the FieldMaskTree in a partial or as separate class in root like JsonFormatter? |
@anandolee @xfxyjwf Still waiting for feedback on your preference how to separate Both are valid ways to proceed with their own up- and downsides. I would prefer the root |
I'd prefer to make FieldMaskTree in a separated file instead of blow FieldMaskPartial up. And yes FieldMaskTree should be internal. |
- Removed FieldMaskUtil - Moved FieldMaskTree to root - Updated tests
Thanks for the feedback. Just applied the changes. |
csharp/src/Google.Protobuf.Test/WellKnownTypes/FieldMaskTest.cs
Outdated
Show resolved
Hide resolved
- Removed internal method FieldMaskTree.GetFieldPaths - Proof FieldMask.Paths only contains expected values
As a short summary: Due to the removal of |
Thanks for the change. It looks good to me, just wait the tests green |
Oh for the newly added FieldMaskTreeTest.cs, you need to update Makefile.am to pass distcheck test: |
@anandolee I hope the distcheck works now :) |
csharp/src/Google.Protobuf/FieldMaskTree.cs is also newly added and need to be in Makefile.am |
Ok, commited. Is it only giving one error a time? This should be all of the newly added files. If there is anything else to check, just let me know :) (Currently I'm in the same timezone as you which should speed stuff up a bit). |
Fixes #4325
I ported the functionality from Java to C#. Still a bit unsure if we should keep the classes seperate as
Utils
or just merging it all intoFieldMaskTreePartial
(would be getting a huge class...). All otherUtils
from Java have been ported into the*Partial
classes, but those were mainly static classes anyway. TheFieldMaskUtil
has a completeFieldMaskTree
helper class.Right now, this would allow for easy portability by keeping the
Util
but also fit with the other classes by creating static helpers inPartial
. Any preferences?@anandolee offered in #4325 to do the PR