Remove source package related comments on internal APIs and csproj/props file. (dotne...
authorAhson Khan <ahkha@microsoft.com>
Thu, 30 May 2019 03:28:27 +0000 (20:28 -0700)
committerGitHub <noreply@github.com>
Thu, 30 May 2019 03:28:27 +0000 (20:28 -0700)
* 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.

Commit migrated from https://github.com/dotnet/corefx/commit/0110344cd384bcfaffed2385cd9df87d956bd68b

src/libraries/System.Text.Json/src/System.Text.Json.csproj
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.DbRow.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.TryGetProperty.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonDocument.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.ArrayEnumerator.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.ObjectEnumerator.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs
src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonProperty.cs
src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs
src/libraries/System.Text.Json/tests/Configurations.props
src/libraries/System.Text.Json/tests/Utf8JsonReaderTests.cs

index 759e042..5bfb8e6 100644 (file)
@@ -6,8 +6,7 @@
     <DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
     <Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
     <!-- For the inbox library (that is shipping with the product), this should always be true. -->
-    <!-- BUILDING_INBOX_LIBRARY is only false when building for netstandard to validate that the sources are netstandard compatible. -->
-    <!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
+    <!-- BUILDING_INBOX_LIBRARY is only false when building the netstandard compatible NuGet package. -->
     <DefineConstants Condition="'$(TargetsNETStandard)' != 'true'">$(DefineConstants);BUILDING_INBOX_LIBRARY</DefineConstants>
     <!-- Workaround for overriding the XML comments related warnings that are being supressed repo wide (within arcade): -->
     <!-- https://github.com/dotnet/arcade/blob/ea6addfdc65e5df1b2c036f11614a5f922e36267/src/Microsoft.DotNet.Arcade.Sdk/tools/ProjectDefaults.props#L90 -->
index 9fe3b6d..78fb28d 100644 (file)
@@ -9,9 +9,6 @@ namespace System.Text.Json
 {
     public sealed partial class JsonDocument
     {
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be used by source-package consumers.
-        /// </summary>
         [StructLayout(LayoutKind.Sequential)]
         internal struct DbRow
         {
index 8e63978..54ebb1c 100644 (file)
@@ -9,9 +9,6 @@ namespace System.Text.Json
 {
     public sealed partial class JsonDocument
     {
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<char> propertyName, out JsonElement value)
         {
             CheckNotDisposed();
@@ -112,9 +109,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetNamedPropertyValue(int index, ReadOnlySpan<byte> propertyName, out JsonElement value)
         {
             CheckNotDisposed();
index 2cdef24..1d4e447 100644 (file)
@@ -27,9 +27,6 @@ namespace System.Text.Json
         private byte[] _extraRentedBytes;
         private (int, string) _lastIndexAndString = (-1, null);
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool IsDisposable { get; }
 
         /// <summary>
@@ -77,9 +74,6 @@ namespace System.Text.Json
             }
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal JsonTokenType GetJsonTokenType(int index)
         {
             CheckNotDisposed();
@@ -87,9 +81,6 @@ namespace System.Text.Json
             return _parsedData.GetJsonTokenType(index);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal int GetArrayLength(int index)
         {
             CheckNotDisposed();
@@ -101,9 +92,6 @@ namespace System.Text.Json
             return row.SizeOrLength;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal JsonElement GetArrayIndexElement(int currentIndex, int arrayIndex)
         {
             CheckNotDisposed();
@@ -152,9 +140,6 @@ namespace System.Text.Json
             throw new IndexOutOfRangeException();
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal int GetEndIndex(int index, bool includeEndElement)
         {
             CheckNotDisposed();
@@ -233,9 +218,6 @@ namespace System.Text.Json
             return _utf8Json.Slice(start, end - start);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetString(int index, JsonTokenType expectedType)
         {
             CheckNotDisposed();
@@ -275,18 +257,12 @@ namespace System.Text.Json
             return lastString;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetNameOfPropertyValue(int index)
         {
             // The property name is one row before the property value
             return GetString(index - DbRow.Size, JsonTokenType.PropertyName);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out int value)
         {
             CheckNotDisposed();
@@ -309,9 +285,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out uint value)
         {
             CheckNotDisposed();
@@ -334,9 +307,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out long value)
         {
             CheckNotDisposed();
@@ -359,9 +329,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out ulong value)
         {
             CheckNotDisposed();
@@ -384,9 +351,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out double value)
         {
             CheckNotDisposed();
@@ -411,9 +375,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out float value)
         {
             CheckNotDisposed();
@@ -438,9 +399,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out decimal value)
         {
             CheckNotDisposed();
@@ -465,9 +423,6 @@ namespace System.Text.Json
             return false;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out DateTime value)
         {
             CheckNotDisposed();
@@ -499,9 +454,6 @@ namespace System.Text.Json
                 && segment.Length == bytesConsumed;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out DateTimeOffset value)
         {
             CheckNotDisposed();
@@ -533,9 +485,6 @@ namespace System.Text.Json
                 && segment.Length == bytesConsumed;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal bool TryGetValue(int index, out Guid value)
         {
             CheckNotDisposed();
@@ -565,27 +514,18 @@ namespace System.Text.Json
             return (segment.Length == JsonConstants.MaximumFormatGuidLength) && Utf8Parser.TryParse(segment, out value, out _, 'D');
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetRawValueAsString(int index)
         {
             ReadOnlyMemory<byte> segment = GetRawValue(index, includeQuotes: true);
             return JsonReaderHelper.TranscodeHelper(segment.Span);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetPropertyRawValueAsString(int valueIndex)
         {
             ReadOnlyMemory<byte> segment = GetPropertyRawValue(valueIndex);
             return JsonReaderHelper.TranscodeHelper(segment.Span);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal JsonElement CloneElement(int index)
         {
             int endIndex = GetEndIndex(index, true);
@@ -598,9 +538,6 @@ namespace System.Text.Json
             return newDocument.RootElement;
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal void WriteElementTo(
             int index,
             Utf8JsonWriter writer,
@@ -642,9 +579,6 @@ namespace System.Text.Json
             Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal void WriteElementTo(
             int index,
             Utf8JsonWriter writer,
@@ -686,9 +620,6 @@ namespace System.Text.Json
             Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}");
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal void WriteElementTo(
             int index,
             Utf8JsonWriter writer)
index 06845bd..53dda79 100644 (file)
@@ -19,9 +19,6 @@ namespace System.Text.Json
             private int _curIdx;
             private readonly int _endIdx;
 
-            /// <summary>
-            ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-            /// </summary>
             internal ArrayEnumerator(JsonElement target)
             {
                 Debug.Assert(target.TokenType == JsonTokenType.StartArray);
index 8cad26d..2b6bcbe 100644 (file)
@@ -19,9 +19,6 @@ namespace System.Text.Json
             private int _curIdx;
             private readonly int _endIdx;
 
-            /// <summary>
-            ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-            /// </summary>
             internal ObjectEnumerator(JsonElement target)
             {
                 Debug.Assert(target.TokenType == JsonTokenType.StartObject);
index 6dbebf8..34be938 100644 (file)
@@ -15,9 +15,6 @@ namespace System.Text.Json
         private readonly JsonDocument _parent;
         private readonly int _idx;
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal JsonElement(JsonDocument parent, int idx)
         {
             // parent is usually not null, but the Current property
@@ -893,9 +890,6 @@ namespace System.Text.Json
             throw new FormatException();
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetPropertyName()
         {
             CheckValidInstance();
@@ -919,9 +913,6 @@ namespace System.Text.Json
             return _parent.GetRawValueAsString(_idx);
         }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal string GetPropertyRawText()
         {
             CheckValidInstance();
index f4d5bb2..04ada6d 100644 (file)
@@ -14,9 +14,6 @@ namespace System.Text.Json
         /// </summary>
         public JsonElement Value { get; }
 
-        /// <summary>
-        ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-        /// </summary>
         internal JsonProperty(JsonElement value)
         {
             Value = value;
index 37d6cfb..de96edb 100644 (file)
@@ -10,9 +10,6 @@ using System.Threading.Tasks;
 
 namespace System.Text.Json.Serialization
 {
-    /// <summary>
-    ///   This is an implementation detail and MUST NOT be called by source-package consumers.
-    /// </summary>
     internal sealed class PooledByteBufferWriter : IBufferWriter<byte>, IDisposable
     {
         private byte[] _rentedBuffer;
index 5085e7e..4e89c41 100644 (file)
@@ -3,8 +3,6 @@
     <BuildConfigurations>
       netcoreapp;
       uap-Windows_NT;
-      <!-- Only included for testing and validating that the sources are netstandard compatible. -->
-      <!-- This is meant to help with producing a source package and not to ship a netstandard compatible binary. -->
       netstandard;
     </BuildConfigurations>
   </PropertyGroup>
index 36c8d3a..2526085 100644 (file)
@@ -3876,6 +3876,9 @@ namespace System.Text.Json.Tests
                     new object[] {"{}", 0},
                     new object[] {"12345", 0},
                     new object[] {"1", 0},
+                    new object[] {"-0", 0},
+                    new object[] {"0.0e-0", 0},
+                    new object[] {"0.0e+0", 0},
                     new object[] {"true", 0},
                     new object[] {"false", 0},
                     new object[] {"null", 0},
@@ -3886,6 +3889,9 @@ namespace System.Text.Json.Tests
                     new object[] {"  {}", 2},
                     new object[] {"  12345", 2},
                     new object[] {"  1", 2},
+                    new object[] {"  -0", 2},
+                    new object[] {"  0.0e-0", 2},
+                    new object[] {"  0.0e+0", 2},
                     new object[] {"  true", 2},
                     new object[] {"  false", 2},
                     new object[] {"  null", 2},
@@ -3896,6 +3902,9 @@ namespace System.Text.Json.Tests
                     new object[] {"  {}  ", 2},
                     new object[] {"  12345  ", 2},
                     new object[] {"  1  ", 2},
+                    new object[] {"  -0  ", 2},
+                    new object[] {"  0.0e-0  ", 2},
+                    new object[] {"  0.0e+0  ", 2},
                     new object[] {"  true  ", 2},
                     new object[] {"  false  ", 2},
                     new object[] {"  null  ", 2},
@@ -4138,11 +4147,17 @@ namespace System.Text.Json.Tests
                     new object[] {"\"\\u12$3\"", 0, 5},
                     new object[] {"\"\\u12\"", 0, 5},
                     new object[] {"\"\\u120\"", 0, 6},
+                    new object[] {"+0", 0, 0},
+                    new object[] {"+1", 0, 0},
+                    new object[] {"0e", 0, 2},
+                    new object[] {"0.", 0, 2},
+                    new object[] {"0.1e", 0, 4},
                     new object[] {"01", 0, 1},
                     new object[] {"1a", 0, 1},
                     new object[] {"-01", 0, 2},
                     new object[] {"10.5e", 0, 5},
                     new object[] {"10.5e-", 0, 6},
+                    new object[] {"10.5e+", 0, 6},
                     new object[] {"10.5e-0.2", 0, 7},
                     new object[] {"{\"age\":30, \"ints\":[1, 2, 3, 4, 5.1e7.3]}", 0, 36},
                     new object[] {"{\"age\":30, \r\n \"num\":-0.e, \r\n \"ints\":[1, 2, 3, 4, 5]}", 1, 10},