Skip to content

Commit 0110344

Browse files
authored
Remove source package related comments on internal APIs and csproj/props file. (dotnet#38004)
* Remove source package related xml comments on internal APIs. * Update comments in csproj and related files to remove source package. * Add some more json reader tests around different json numbers.
1 parent a2afbff commit 0110344

11 files changed

+16
-103
lines changed

src/System.Text.Json/src/System.Text.Json.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
77
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
88
<!-- For the inbox library (that is shipping with the product), this should always be true. -->
9-
<!-- BUILDING_INBOX_LIBRARY is only false when building for netstandard to validate that the sources are netstandard compatible. -->
10-
<!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
9+
<!-- BUILDING_INBOX_LIBRARY is only false when building the netstandard compatible NuGet package. -->
1110
<DefineConstants Condition="'$(TargetsNETStandard)' != 'true'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants>
1211
<!-- Workaround for overriding the XML comments related warnings that are being supressed repo wide (within arcade): -->
1312
<!-- https://github.com/dotnet/arcade/blob/ea6addfdc65e5df1b2c036f11614a5f922e36267/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props#L90 -->

src/System.Text.Json/src/System/Text/Json/Document/JsonDocument.DbRow.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ namespace System.Text.Json
99
{
1010
public sealed partial class JsonDocument
1111
{
12-
/// <summary>
13-
/// This is an implementation detail and MUST NOT be used by source-package consumers.
14-
/// </summary>
1512
[StructLayout(LayoutKind.Sequential)]
1613
internal struct DbRow
1714
{

src/System.Text.Json/src/System/Text/Json/Document/JsonDocument.TryGetProperty.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ namespace System.Text.Json
99
{
1010
public sealed partial class JsonDocument
1111
{
12-
/// <summary>
13-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
14-
/// </summary>
1512
internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<char> propertyName, out JsonElement value)
1613
{
1714
CheckNotDisposed();
@@ -112,9 +109,6 @@ internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<char> propertyNam
112109
return false;
113110
}
114111

115-
/// <summary>
116-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
117-
/// </summary>
118112
internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<byte> propertyName, out JsonElement value)
119113
{
120114
CheckNotDisposed();

src/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public sealed partial class JsonDocument : IDisposable
2727
private byte[] _extraRentedBytes;
2828
private (int, string) _lastIndexAndString = (-1, null);
2929

30-
/// <summary>
31-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
32-
/// </summary>
3330
internal bool IsDisposable { get; }
3431

3532
/// <summary>
@@ -77,19 +74,13 @@ public void Dispose()
7774
}
7875
}
7976

80-
/// <summary>
81-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
82-
/// </summary>
8377
internal JsonTokenType GetJsonTokenType(int index)
8478
{
8579
CheckNotDisposed();
8680

8781
return _parsedData.GetJsonTokenType(index);
8882
}
8983

90-
/// <summary>
91-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
92-
/// </summary>
9384
internal int GetArrayLength(int index)
9485
{
9586
CheckNotDisposed();
@@ -101,9 +92,6 @@ internal int GetArrayLength(int index)
10192
return row.SizeOrLength;
10293
}
10394

104-
/// <summary>
105-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
106-
/// </summary>
10795
internal JsonElement GetArrayIndexElement(int currentIndex, int arrayIndex)
10896
{
10997
CheckNotDisposed();
@@ -152,9 +140,6 @@ internal JsonElement GetArrayIndexElement(int currentIndex, int arrayIndex)
152140
throw new IndexOutOfRangeException();
153141
}
154142

155-
/// <summary>
156-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
157-
/// </summary>
158143
internal int GetEndIndex(int index, bool includeEndElement)
159144
{
160145
CheckNotDisposed();
@@ -233,9 +218,6 @@ private ReadOnlyMemory<byte> GetPropertyRawValue(int valueIndex)
233218
return _utf8Json.Slice(start, end - start);
234219
}
235220

236-
/// <summary>
237-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
238-
/// </summary>
239221
internal string GetString(int index, JsonTokenType expectedType)
240222
{
241223
CheckNotDisposed();
@@ -275,18 +257,12 @@ internal string GetString(int index, JsonTokenType expectedType)
275257
return lastString;
276258
}
277259

278-
/// <summary>
279-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
280-
/// </summary>
281260
internal string GetNameOfPropertyValue(int index)
282261
{
283262
// The property name is one row before the property value
284263
return GetString(index - DbRow.Size, JsonTokenType.PropertyName);
285264
}
286265

287-
/// <summary>
288-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
289-
/// </summary>
290266
internal bool TryGetValue(int index, out int value)
291267
{
292268
CheckNotDisposed();
@@ -309,9 +285,6 @@ internal bool TryGetValue(int index, out int value)
309285
return false;
310286
}
311287

312-
/// <summary>
313-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
314-
/// </summary>
315288
internal bool TryGetValue(int index, out uint value)
316289
{
317290
CheckNotDisposed();
@@ -334,9 +307,6 @@ internal bool TryGetValue(int index, out uint value)
334307
return false;
335308
}
336309

337-
/// <summary>
338-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
339-
/// </summary>
340310
internal bool TryGetValue(int index, out long value)
341311
{
342312
CheckNotDisposed();
@@ -359,9 +329,6 @@ internal bool TryGetValue(int index, out long value)
359329
return false;
360330
}
361331

362-
/// <summary>
363-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
364-
/// </summary>
365332
internal bool TryGetValue(int index, out ulong value)
366333
{
367334
CheckNotDisposed();
@@ -384,9 +351,6 @@ internal bool TryGetValue(int index, out ulong value)
384351
return false;
385352
}
386353

387-
/// <summary>
388-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
389-
/// </summary>
390354
internal bool TryGetValue(int index, out double value)
391355
{
392356
CheckNotDisposed();
@@ -411,9 +375,6 @@ internal bool TryGetValue(int index, out double value)
411375
return false;
412376
}
413377

414-
/// <summary>
415-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
416-
/// </summary>
417378
internal bool TryGetValue(int index, out float value)
418379
{
419380
CheckNotDisposed();
@@ -438,9 +399,6 @@ internal bool TryGetValue(int index, out float value)
438399
return false;
439400
}
440401

441-
/// <summary>
442-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
443-
/// </summary>
444402
internal bool TryGetValue(int index, out decimal value)
445403
{
446404
CheckNotDisposed();
@@ -465,9 +423,6 @@ internal bool TryGetValue(int index, out decimal value)
465423
return false;
466424
}
467425

468-
/// <summary>
469-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
470-
/// </summary>
471426
internal bool TryGetValue(int index, out DateTime value)
472427
{
473428
CheckNotDisposed();
@@ -499,9 +454,6 @@ internal bool TryGetValue(int index, out DateTime value)
499454
&& segment.Length == bytesConsumed;
500455
}
501456

502-
/// <summary>
503-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
504-
/// </summary>
505457
internal bool TryGetValue(int index, out DateTimeOffset value)
506458
{
507459
CheckNotDisposed();
@@ -533,9 +485,6 @@ internal bool TryGetValue(int index, out DateTimeOffset value)
533485
&& segment.Length == bytesConsumed;
534486
}
535487

536-
/// <summary>
537-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
538-
/// </summary>
539488
internal bool TryGetValue(int index, out Guid value)
540489
{
541490
CheckNotDisposed();
@@ -565,27 +514,18 @@ internal bool TryGetValue(int index, out Guid value)
565514
return (segment.Length == JsonConstants.MaximumFormatGuidLength) && Utf8Parser.TryParse(segment, out value, out _, 'D');
566515
}
567516

568-
/// <summary>
569-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
570-
/// </summary>
571517
internal string GetRawValueAsString(int index)
572518
{
573519
ReadOnlyMemory<byte> segment = GetRawValue(index, includeQuotes: true);
574520
return JsonReaderHelper.TranscodeHelper(segment.Span);
575521
}
576522

577-
/// <summary>
578-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
579-
/// </summary>
580523
internal string GetPropertyRawValueAsString(int valueIndex)
581524
{
582525
ReadOnlyMemory<byte> segment = GetPropertyRawValue(valueIndex);
583526
return JsonReaderHelper.TranscodeHelper(segment.Span);
584527
}
585528

586-
/// <summary>
587-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
588-
/// </summary>
589529
internal JsonElement CloneElement(int index)
590530
{
591531
int endIndex = GetEndIndex(index, true);
@@ -598,9 +538,6 @@ internal JsonElement CloneElement(int index)
598538
return newDocument.RootElement;
599539
}
600540

601-
/// <summary>
602-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
603-
/// </summary>
604541
internal void WriteElementTo(
605542
int index,
606543
Utf8JsonWriter writer,
@@ -642,9 +579,6 @@ internal void WriteElementTo(
642579
Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
643580
}
644581

645-
/// <summary>
646-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
647-
/// </summary>
648582
internal void WriteElementTo(
649583
int index,
650584
Utf8JsonWriter writer,
@@ -686,9 +620,6 @@ internal void WriteElementTo(
686620
Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
687621
}
688622

689-
/// <summary>
690-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
691-
/// </summary>
692623
internal void WriteElementTo(
693624
int index,
694625
Utf8JsonWriter writer)

src/System.Text.Json/src/System/Text/Json/Document/JsonElement.ArrayEnumerator.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ public struct ArrayEnumerator : IEnumerable<JsonElement>, IEnumerator<JsonElemen
1919
private int _curIdx;
2020
private readonly int _endIdx;
2121

22-
/// <summary>
23-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
24-
/// </summary>
2522
internal ArrayEnumerator(JsonElement target)
2623
{
2724
Debug.Assert(target.TokenType == JsonTokenType.StartArray);

src/System.Text.Json/src/System/Text/Json/Document/JsonElement.ObjectEnumerator.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ public struct ObjectEnumerator : IEnumerable<JsonProperty>, IEnumerator<JsonProp
1919
private int _curIdx;
2020
private readonly int _endIdx;
2121

22-
/// <summary>
23-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
24-
/// </summary>
2522
internal ObjectEnumerator(JsonElement target)
2623
{
2724
Debug.Assert(target.TokenType == JsonTokenType.StartObject);

src/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ public readonly partial struct JsonElement
1515
private readonly JsonDocument _parent;
1616
private readonly int _idx;
1717

18-
/// <summary>
19-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
20-
/// </summary>
2118
internal JsonElement(JsonDocument parent, int idx)
2219
{
2320
// parent is usually not null, but the Current property
@@ -893,9 +890,6 @@ public Guid GetGuid()
893890
throw new FormatException();
894891
}
895892

896-
/// <summary>
897-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
898-
/// </summary>
899893
internal string GetPropertyName()
900894
{
901895
CheckValidInstance();
@@ -919,9 +913,6 @@ public string GetRawText()
919913
return _parent.GetRawValueAsString(_idx);
920914
}
921915

922-
/// <summary>
923-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
924-
/// </summary>
925916
internal string GetPropertyRawText()
926917
{
927918
CheckValidInstance();

src/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ public readonly struct JsonProperty
1414
/// </summary>
1515
public JsonElement Value { get; }
1616

17-
/// <summary>
18-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
19-
/// </summary>
2017
internal JsonProperty(JsonElement value)
2118
{
2219
Value = value;

src/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
namespace System.Text.Json.Serialization
1212
{
13-
/// <summary>
14-
/// This is an implementation detail and MUST NOT be called by source-package consumers.
15-
/// </summary>
1613
internal sealed class PooledByteBufferWriter : IBufferWriter<byte>, IDisposable
1714
{
1815
private byte[] _rentedBuffer;

src/System.Text.Json/tests/Configurations.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<BuildConfigurations>
44
netcoreapp;
55
uap-Windows_NT;
6-
<!-- Only included for testing and validating that the sources are netstandard compatible. -->
7-
<!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
86
netstandard;
97
</BuildConfigurations>
108
</PropertyGroup>

src/System.Text.Json/tests/Utf8JsonReaderTests.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3876,6 +3876,9 @@ public static IEnumerable<object[]> SingleJsonTokenStartIndex
38763876
new object[] {"{}", 0},
38773877
new object[] {"12345", 0},
38783878
new object[] {"1", 0},
3879+
new object[] {"-0", 0},
3880+
new object[] {"0.0e-0", 0},
3881+
new object[] {"0.0e+0", 0},
38793882
new object[] {"true", 0},
38803883
new object[] {"false", 0},
38813884
new object[] {"null", 0},
@@ -3886,6 +3889,9 @@ public static IEnumerable<object[]> SingleJsonTokenStartIndex
38863889
new object[] {" {}", 2},
38873890
new object[] {" 12345", 2},
38883891
new object[] {" 1", 2},
3892+
new object[] {" -0", 2},
3893+
new object[] {" 0.0e-0", 2},
3894+
new object[] {" 0.0e+0", 2},
38893895
new object[] {" true", 2},
38903896
new object[] {" false", 2},
38913897
new object[] {" null", 2},
@@ -3896,6 +3902,9 @@ public static IEnumerable<object[]> SingleJsonTokenStartIndex
38963902
new object[] {" {} ", 2},
38973903
new object[] {" 12345 ", 2},
38983904
new object[] {" 1 ", 2},
3905+
new object[] {" -0 ", 2},
3906+
new object[] {" 0.0e-0 ", 2},
3907+
new object[] {" 0.0e+0 ", 2},
38993908
new object[] {" true ", 2},
39003909
new object[] {" false ", 2},
39013910
new object[] {" null ", 2},
@@ -4138,11 +4147,17 @@ public static IEnumerable<object[]> InvalidJsonStrings
41384147
new object[] {"\"\\u12$3\"", 0, 5},
41394148
new object[] {"\"\\u12\"", 0, 5},
41404149
new object[] {"\"\\u120\"", 0, 6},
4150+
new object[] {"+0", 0, 0},
4151+
new object[] {"+1", 0, 0},
4152+
new object[] {"0e", 0, 2},
4153+
new object[] {"0.", 0, 2},
4154+
new object[] {"0.1e", 0, 4},
41414155
new object[] {"01", 0, 1},
41424156
new object[] {"1a", 0, 1},
41434157
new object[] {"-01", 0, 2},
41444158
new object[] {"10.5e", 0, 5},
41454159
new object[] {"10.5e-", 0, 6},
4160+
new object[] {"10.5e+", 0, 6},
41464161
new object[] {"10.5e-0.2", 0, 7},
41474162
new object[] {"{\"age\":30, \"ints\":[1, 2, 3, 4, 5.1e7.3]}", 0, 36},
41484163
new object[] {"{\"age\":30, \r\n \"num\":-0.e, \r\n \"ints\":[1, 2, 3, 4, 5]}", 1, 10},

0 commit comments

Comments
 (0)