• Jon Skeet's avatar
    Ensure that FieldMask, Timestamp and Duration ToString() calls don't throw · dd43dcca
    Jon Skeet authored
    The usage of ICustomDiagnosticMessage here is non-essential - ToDiagnosticString
    doesn't actually get called by ToString() in this case, due to JsonFormatter code. It was
    intended to make it clearer that it *did* have a custom format... but then arguably I should
    do the same for Value, Struct, Any etc.
    
    Moving some of the code out of JsonFormatter and into Duration/Timestamp/FieldMask likewise
    feels somewhat nice, somewhat nasty... basically there are JSON-specific bits of formatting, but
    also domain-specific bits of computation. <sigh>
    
    Thoughts welcome.
    dd43dcca
Google.Protobuf.csproj 8.77 KB