Skip to content

Commit

Permalink
Fix merge: duplicate parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
boukeversteegh committed Jun 17, 2022
1 parent 036a4bc commit ec0e840
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions csharp/src/Google.Protobuf/JsonFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private static bool IsDefaultValue(FieldDescriptor descriptor, object value)
/// </summary>
/// <param name="writer">The writer to write the value to. Must not be null.</param>
/// <param name="value">The value to write. May be null.</param>
/// <remarks>Delegates to <c>WriteValue(TextWriter, object, int)</c> with <c>indentationLevel = 0</c>.</remarks>
/// <remarks>Delegates to <c>WriteValue(TextWriter, object, int)</c> with <c>indentationLevel = 0</c>.</remarks>
public void WriteValue(TextWriter writer, object value) => WriteValue(writer, value, 0);

/// <summary>
Expand Down Expand Up @@ -820,7 +820,7 @@ private static void HexEncodeUtf16CodeUnit(TextWriter writer, char c)
writer.Write(Hex[(c >> 4) & 0xf]);
writer.Write(Hex[(c >> 0) & 0xf]);
}

private void WriteBracketOpen(TextWriter writer, char openChar)
{
writer.Write(openChar);
Expand All @@ -844,7 +844,7 @@ private void WriteBracketClose(TextWriter writer, char closeChar, bool hasFields
writer.Write(" ");
}
}

writer.Write(closeChar);
}

Expand Down Expand Up @@ -940,7 +940,6 @@ private Settings(bool formatDefaultValues,
TypeRegistry typeRegistry,
bool formatEnumsAsIntegers,
bool preserveProtoFieldNames,
bool formatEnumsAsIntegers,
string indentation = null)
{
FormatDefaultValues = formatDefaultValues;
Expand Down Expand Up @@ -973,13 +972,13 @@ private Settings(bool formatDefaultValues,
/// </summary>
/// <param name="preserveProtoFieldNames"><c>true</c> to preserve proto field names; <c>false</c> to convert them to lowerCamelCase.</param>
public Settings WithPreserveProtoFieldNames(bool preserveProtoFieldNames) => new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, preserveProtoFieldNames, Indentation);

/// <summary>
/// Creates a new <see cref="Settings"/> object with the specified indentation and the current settings.
/// </summary>
/// <param name="indentation">The string to output for each level of indentation (nesting). The default is two spaces per level. Use null to disable indentation entirely.</param>
/// <remarks>A non-null value for <see cref="Indentation"/> will insert additional line-breaks to the JSON output. Each line will contain either a single value, or braces. The default line-break is determined by <see cref="Environment.NewLine"/>, which is <c>"\n"</c> on Unix platforms, and <c>"\r\n"</c> on Windows. If <see cref="JsonFormatter"/> seems to produce empty lines, you need to pass a <see cref="TextWriter"/> that uses a <c>"\n"</c> newline. See <see cref="JsonFormatter.Format(Google.Protobuf.IMessage, TextWriter)"/>.</remarks>
public Settings WithIndentation(string indentation = " ") => new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, indentation);
public Settings WithIndentation(string indentation = " ") => new Settings(FormatDefaultValues, TypeRegistry, FormatEnumsAsIntegers, PreserveProtoFieldNames, indentation);
}

// Effectively a cache of mapping from enum values to the original name as specified in the proto file,
Expand Down

0 comments on commit ec0e840

Please sign in to comment.