Skip to content

Commit

Permalink
Address dotnet/corefx#37794 by removing "UTF-16" when not needed in S…
Browse files Browse the repository at this point in the history
…ystem.Text.Json docs (dotnet/corefx#37866)

* Remove UTF-16 notes from summary and param comments dotnet/corefx#37794

* Remove UTF-16 references from JsonEncodedText comments

* Address PR review comments by @ahsonkhan


Commit migrated from dotnet/corefx@c539d6c
  • Loading branch information
watfordgnf authored and ahsonkhan committed May 24, 2019
1 parent 80dbb04 commit 052b356
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private JsonEncodedText(byte[] utf8Value)
/// <summary>
/// Encodes the string text value as a JSON string.
/// </summary>
/// <param name="value">The UTF-16 encoded value to be transformed as JSON encoded text.</param>
/// <param name="value">The value to be transformed as JSON encoded text.</param>
/// <exception cref="ArgumentNullException">
/// Thrown if value is null.
/// </exception>
Expand All @@ -50,9 +50,9 @@ public static JsonEncodedText Encode(string value)
}

/// <summary>
/// Encodes the UTF-16 text value as a JSON string.
/// Encodes the text value as a JSON string.
/// </summary>
/// <param name="value">The UTF-16 encoded value to be transformed as JSON encoded text.</param>
/// <param name="value">The value to be transformed as JSON encoded text.</param>
/// <exception cref="ArgumentException">
/// Thrown when the specified value is too large or if it contains invalid UTF-16 characters.
/// </exception>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ private bool TextEqualsHelper(ReadOnlySpan<byte> otherUtf8Text)
}

/// <summary>
/// Compares the UTF-16 encoded text to the unescaped JSON token value in the source and returns true if they match.
/// Compares the text to the unescaped JSON token value in the source and returns true if they match.
/// </summary>
/// <param name="otherText">The UTF-16 encoded text to compare against.</param>
/// <returns>True if the JSON token value in the source matches the UTF-16 encoded look up text.</returns>
/// <param name="otherText">The text to compare against.</param>
/// <returns>True if the JSON token value in the source matches the look up text.</returns>
/// <exception cref="InvalidOperationException">
/// Thrown if trying to find a text match on a JSON token that is not a string
/// (i.e. other than <see cref="JsonTokenType.String"/> or <see cref="JsonTokenType.PropertyName"/>).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static partial class JsonSerializer
/// <typeparamref name="TValue"/> is not compatible with the JSON,
/// or when there is remaining data in the Stream.
/// </exception>
/// <remarks>Using a UTF-16 <see cref="System.String"/> is not as efficient as using the
/// <remarks>Using a <see cref="System.String"/> is not as efficient as using the
/// UTF-8 methods since the implementation natively uses UTF-8.
/// </remarks>
public static TValue Parse<TValue>(string json, JsonSerializerOptions options = null)
Expand All @@ -46,7 +46,7 @@ public static TValue Parse<TValue>(string json, JsonSerializerOptions options =
/// the <paramref name="returnType"/> is not compatible with the JSON,
/// or when there is remaining data in the Stream.
/// </exception>
/// <remarks>Using a UTF-16 <see cref="System.String"/> is not as efficient as using the
/// <remarks>Using a <see cref="System.String"/> is not as efficient as using the
/// UTF-8 methods since the implementation natively uses UTF-8.
/// </remarks>
public static object Parse(string json, Type returnType, JsonSerializerOptions options = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void WriteStringHelper(ReadOnlySpan<byte> utf8PropertyName, DateTime val
/// <summary>
/// Writes the property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -60,7 +60,7 @@ public void WriteString(string propertyName, DateTime value)
/// <summary>
/// Writes the property name and <see cref="DateTime"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void WriteStringHelper(ReadOnlySpan<byte> utf8PropertyName, DateTimeOffs
/// <summary>
/// Writes the property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -60,7 +60,7 @@ public void WriteString(string propertyName, DateTimeOffset value)
/// <summary>
/// Writes the property name and <see cref="DateTimeOffset"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void WriteNumberHelper(ReadOnlySpan<byte> utf8PropertyName, decimal valu
/// <summary>
/// Writes the property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -60,7 +60,7 @@ public void WriteNumber(string propertyName, decimal value)
/// <summary>
/// Writes the property name and <see cref="decimal"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private void WriteNumberHelper(ReadOnlySpan<byte> utf8PropertyName, double value
/// <summary>
/// Writes the property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -62,7 +62,7 @@ public void WriteNumber(string propertyName, double value)
/// <summary>
/// Writes the property name and <see cref="double"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private void WriteNumberHelper(ReadOnlySpan<byte> utf8PropertyName, float value)
/// <summary>
/// Writes the property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -62,7 +62,7 @@ public void WriteNumber(string propertyName, float value)
/// <summary>
/// Writes the property name and <see cref="float"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed partial class Utf8JsonWriter
/// <summary>
/// Writes the property name and value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="utf8FormattedNumber">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void WriteStringHelper(ReadOnlySpan<byte> utf8PropertyName, Guid value)
/// <summary>
/// Writes the property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -60,7 +60,7 @@ public void WriteString(string propertyName, Guid value)
/// <summary>
/// Writes the property name and <see cref="Guid"/> value (as a JSON string) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON string as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void WriteLiteralHelper(ReadOnlySpan<byte> utf8PropertyName, ReadOnlySpa
/// <summary>
/// Writes the property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
Expand All @@ -53,7 +53,7 @@ public void WriteNull(string propertyName)
/// <summary>
/// Writes the property name and the JSON literal "null" as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <remarks>
/// The property name is escaped before writing.
/// </remarks>
Expand Down Expand Up @@ -128,7 +128,7 @@ public void WriteBoolean(JsonEncodedText propertyName, bool value)
/// <summary>
/// Writes the property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -145,7 +145,7 @@ public void WriteBoolean(string propertyName, bool value)
/// <summary>
/// Writes the property name and <see cref="bool"/> value (as a JSON literal "true" or "false") as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON literal "true" or "false" as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void WriteNumberHelper(ReadOnlySpan<byte> utf8PropertyName, long value)
/// <summary>
/// Writes the property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -60,7 +60,7 @@ public void WriteNumber(string propertyName, long value)
/// <summary>
/// Writes the property name and <see cref="long"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down Expand Up @@ -131,7 +131,7 @@ public void WriteNumber(JsonEncodedText propertyName, int value)
/// <summary>
/// Writes the property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand All @@ -151,7 +151,7 @@ public void WriteNumber(string propertyName, int value)
/// <summary>
/// Writes the property name and <see cref="int"/> value (as a JSON number) as part of a name/value pair of a JSON object.
/// </summary>
/// <param name="propertyName">The UTF-16 encoded property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="propertyName">The property name of the JSON object to be transcoded and written as UTF-8.</param>
/// <param name="value">The value to be written as a JSON number as part of the name/value pair.</param>
/// <remarks>
/// The property name is escaped before writing.
Expand Down
Loading

0 comments on commit 052b356

Please sign in to comment.