Skip to content

Commit 0bb2bad

Browse files
committed
Updated to the latest version of json.net 8.0.2
We upgraded from 6.0.8. This should allow us to port to coreclr easier
1 parent 921ebca commit 0bb2bad

File tree

149 files changed

+8017
-2397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+8017
-2397
lines changed

Source/Shared/Exceptionless.Portable.csproj

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -60,73 +60,6 @@
6060
<Compile Include="Dependency\TinyIoC.cs" />
6161
<Compile Include="Events\EventSubmissionEventArgsBase.cs" />
6262
<Compile Include="Events\EventSubmittedEventArgs.cs" />
63-
<Compile Include="Plugins\Default\030_DuplicateCheckerPlugin.cs" />
64-
<Compile Include="Plugins\ContextData.cs" />
65-
<Compile Include="Plugins\Default\1000_CancelSessionsWithNoUserPlugin.cs" />
66-
<Compile Include="Plugins\Default\100_HeartbeatPlugin.cs" />
67-
<Compile Include="Plugins\Default\ActionPlugin.cs" />
68-
<Compile Include="Plugins\Default\010_ConfigurationDefaultsPlugin.cs" />
69-
<Compile Include="Plugins\Default\090_SubmissionMethodPlugin.cs" />
70-
<Compile Include="Plugins\Default\040_ReferenceIdPlugin.cs" />
71-
<Compile Include="Plugins\Default\020_SimpleErrorPlugin.cs" />
72-
<Compile Include="Plugins\Default\050_EnvironmentInfoPlugin.cs" />
73-
<Compile Include="Plugins\PriortyAttribute.cs" />
74-
<Compile Include="EventBuilder.cs" />
75-
<Compile Include="Events\ConfigurationUpdatedEventArgs.cs" />
76-
<Compile Include="Events\EventSubmittingEventArgs.cs" />
77-
<Compile Include="ExceptionlessClient.cs" />
78-
<Compile Include="Extensions\EventBuilderExtensions.cs" />
79-
<Compile Include="Extensions\ExceptionlessConfigurationExtensions.cs" />
80-
<Compile Include="Extensions\EnumerableExtensions.cs" />
81-
<Compile Include="Extensions\DataDictionaryExtensions.cs" />
82-
<Compile Include="Extensions\EventExtensions.cs" />
83-
<Compile Include="Extensions\ExceptionExtensions.cs" />
84-
<Compile Include="Extensions\ClientExtensions.cs" />
85-
<Compile Include="Extensions\FileStorageExtensions.cs" />
86-
<Compile Include="Extensions\NumberExtensions.cs" />
87-
<Compile Include="Extensions\TaskExtensions.cs" />
88-
<Compile Include="Extensions\TaskFactoryExtensions.cs" />
89-
<Compile Include="Extensions\ToSimpleErrorModelExtensions.cs" />
90-
<Compile Include="Extensions\TypeExtensions.cs" />
91-
<Compile Include="Extensions\WebResponseExtensions.cs" />
92-
<Compile Include="Extensions\JsonSerializerExtensions.cs" />
93-
<Compile Include="Extensions\StringExtensions.cs" />
94-
<Compile Include="Extensions\WebRequestExtensions.cs">
95-
<SubType>Code</SubType>
96-
</Compile>
97-
<Compile Include="LastReferenceIdManager\DefaultLastReferenceIdManager.cs" />
98-
<Compile Include="LastReferenceIdManager\ILastReferenceIdManager.cs" />
99-
<Compile Include="Logging\DebugExceptionlessLog.cs" />
100-
<Compile Include="Logging\InMemoryExceptionlessLog.cs" />
101-
<Compile Include="Logging\LogLevel.cs" />
102-
<Compile Include="Plugins\EventPluginManager.cs" />
103-
<Compile Include="Plugins\EventPluginContext.cs" />
104-
<Compile Include="Plugins\IEventPlugin.cs" />
105-
<Compile Include="Models\Client\ClientConfiguration.cs" />
106-
<Compile Include="Models\Client\Data\EnvironmentInfo.cs" />
107-
<Compile Include="Models\Client\Data\Error.cs" />
108-
<Compile Include="Models\Client\Data\InnerError.cs" />
109-
<Compile Include="Models\Client\Data\Method.cs" />
110-
<Compile Include="Models\Client\Data\Module.cs" />
111-
<Compile Include="Models\Client\Data\Parameter.cs" />
112-
<Compile Include="Models\Client\Data\RequestInfo.cs" />
113-
<Compile Include="Models\Client\Data\SimpleError.cs" />
114-
<Compile Include="Models\Client\Data\StackFrame.cs" />
115-
<Compile Include="Models\Client\Data\UserDescription.cs" />
116-
<Compile Include="Models\Client\Data\UserInfo.cs" />
117-
<Compile Include="Models\Client\Event.cs" />
118-
<Compile Include="Models\Collections\DataDictionary.cs" />
119-
<Compile Include="Models\Collections\GenericArguments.cs" />
120-
<Compile Include="Models\Collections\ModuleCollection.cs" />
121-
<Compile Include="Models\Collections\ObservableDictionary.cs" />
122-
<Compile Include="Models\Collections\ParameterCollection.cs" />
123-
<Compile Include="Models\Collections\SettingsDictionary.cs" />
124-
<Compile Include="Models\Collections\StackFrameCollection.cs" />
125-
<Compile Include="Models\Collections\TagSet.cs" />
126-
<Compile Include="Extensions\MethodExtensions.cs" />
127-
<Compile Include="Extensions\ParameterExtensions.cs" />
128-
<Compile Include="Extensions\RequestInfoExtensions.cs" />
129-
<Compile Include="Models\Interfaces\IData.cs" />
13063
<Compile Include="Newtonsoft.Json\Bson\BsonBinaryType.cs" />
13164
<Compile Include="Newtonsoft.Json\Bson\BsonBinaryWriter.cs" />
13265
<Compile Include="Newtonsoft.Json\Bson\BsonObjectId.cs" />
@@ -159,6 +92,7 @@
15992
<Compile Include="Newtonsoft.Json\FloatParseHandling.cs" />
16093
<Compile Include="Newtonsoft.Json\FormatterAssemblyStyle.cs" />
16194
<Compile Include="Newtonsoft.Json\Formatting.cs" />
95+
<Compile Include="Newtonsoft.Json\IArrayPool.cs" />
16296
<Compile Include="Newtonsoft.Json\IJsonLineInfo.cs" />
16397
<Compile Include="Newtonsoft.Json\JsonArrayAttribute.cs" />
16498
<Compile Include="Newtonsoft.Json\JsonConstructorAttribute.cs" />
@@ -176,6 +110,7 @@
176110
<Compile Include="Newtonsoft.Json\JsonPropertyAttribute.cs" />
177111
<Compile Include="Newtonsoft.Json\JsonReader.cs" />
178112
<Compile Include="Newtonsoft.Json\JsonReaderException.cs" />
113+
<Compile Include="Newtonsoft.Json\JsonRequiredAttribute.cs" />
179114
<Compile Include="Newtonsoft.Json\JsonSerializationException.cs" />
180115
<Compile Include="Newtonsoft.Json\JsonSerializer.cs" />
181116
<Compile Include="Newtonsoft.Json\JsonSerializerSettings.cs" />
@@ -185,6 +120,7 @@
185120
<Compile Include="Newtonsoft.Json\JsonValidatingReader.cs" />
186121
<Compile Include="Newtonsoft.Json\JsonWriter.cs" />
187122
<Compile Include="Newtonsoft.Json\JsonWriterException.cs" />
123+
<Compile Include="Newtonsoft.Json\Linq\CommentHandling.cs" />
188124
<Compile Include="Newtonsoft.Json\Linq\Extensions.cs" />
189125
<Compile Include="Newtonsoft.Json\Linq\IJEnumerable.cs" />
190126
<Compile Include="Newtonsoft.Json\Linq\JArray.cs" />
@@ -196,6 +132,7 @@
196132
<Compile Include="Newtonsoft.Json\Linq\JPropertyDescriptor.cs" />
197133
<Compile Include="Newtonsoft.Json\Linq\JPropertyKeyedCollection.cs" />
198134
<Compile Include="Newtonsoft.Json\Linq\JRaw.cs" />
135+
<Compile Include="Newtonsoft.Json\Linq\JsonLoadSettings.cs" />
199136
<Compile Include="Newtonsoft.Json\Linq\JsonMergeSettings.cs" />
200137
<Compile Include="Newtonsoft.Json\Linq\JsonPath\ArrayIndexFilter.cs" />
201138
<Compile Include="Newtonsoft.Json\Linq\JsonPath\ArrayMultipleIndexFilter.cs" />
@@ -317,6 +254,73 @@
317254
<Compile Include="Newtonsoft.Json\Utilities\TypeExtensions.cs" />
318255
<Compile Include="Newtonsoft.Json\Utilities\ValidationUtils.cs" />
319256
<Compile Include="Newtonsoft.Json\WriteState.cs" />
257+
<Compile Include="Plugins\Default\030_DuplicateCheckerPlugin.cs" />
258+
<Compile Include="Plugins\ContextData.cs" />
259+
<Compile Include="Plugins\Default\1000_CancelSessionsWithNoUserPlugin.cs" />
260+
<Compile Include="Plugins\Default\100_HeartbeatPlugin.cs" />
261+
<Compile Include="Plugins\Default\ActionPlugin.cs" />
262+
<Compile Include="Plugins\Default\010_ConfigurationDefaultsPlugin.cs" />
263+
<Compile Include="Plugins\Default\090_SubmissionMethodPlugin.cs" />
264+
<Compile Include="Plugins\Default\040_ReferenceIdPlugin.cs" />
265+
<Compile Include="Plugins\Default\020_SimpleErrorPlugin.cs" />
266+
<Compile Include="Plugins\Default\050_EnvironmentInfoPlugin.cs" />
267+
<Compile Include="Plugins\PriortyAttribute.cs" />
268+
<Compile Include="EventBuilder.cs" />
269+
<Compile Include="Events\ConfigurationUpdatedEventArgs.cs" />
270+
<Compile Include="Events\EventSubmittingEventArgs.cs" />
271+
<Compile Include="ExceptionlessClient.cs" />
272+
<Compile Include="Extensions\EventBuilderExtensions.cs" />
273+
<Compile Include="Extensions\ExceptionlessConfigurationExtensions.cs" />
274+
<Compile Include="Extensions\EnumerableExtensions.cs" />
275+
<Compile Include="Extensions\DataDictionaryExtensions.cs" />
276+
<Compile Include="Extensions\EventExtensions.cs" />
277+
<Compile Include="Extensions\ExceptionExtensions.cs" />
278+
<Compile Include="Extensions\ClientExtensions.cs" />
279+
<Compile Include="Extensions\FileStorageExtensions.cs" />
280+
<Compile Include="Extensions\NumberExtensions.cs" />
281+
<Compile Include="Extensions\TaskExtensions.cs" />
282+
<Compile Include="Extensions\TaskFactoryExtensions.cs" />
283+
<Compile Include="Extensions\ToSimpleErrorModelExtensions.cs" />
284+
<Compile Include="Extensions\TypeExtensions.cs" />
285+
<Compile Include="Extensions\WebResponseExtensions.cs" />
286+
<Compile Include="Extensions\JsonSerializerExtensions.cs" />
287+
<Compile Include="Extensions\StringExtensions.cs" />
288+
<Compile Include="Extensions\WebRequestExtensions.cs">
289+
<SubType>Code</SubType>
290+
</Compile>
291+
<Compile Include="LastReferenceIdManager\DefaultLastReferenceIdManager.cs" />
292+
<Compile Include="LastReferenceIdManager\ILastReferenceIdManager.cs" />
293+
<Compile Include="Logging\DebugExceptionlessLog.cs" />
294+
<Compile Include="Logging\InMemoryExceptionlessLog.cs" />
295+
<Compile Include="Logging\LogLevel.cs" />
296+
<Compile Include="Plugins\EventPluginManager.cs" />
297+
<Compile Include="Plugins\EventPluginContext.cs" />
298+
<Compile Include="Plugins\IEventPlugin.cs" />
299+
<Compile Include="Models\Client\ClientConfiguration.cs" />
300+
<Compile Include="Models\Client\Data\EnvironmentInfo.cs" />
301+
<Compile Include="Models\Client\Data\Error.cs" />
302+
<Compile Include="Models\Client\Data\InnerError.cs" />
303+
<Compile Include="Models\Client\Data\Method.cs" />
304+
<Compile Include="Models\Client\Data\Module.cs" />
305+
<Compile Include="Models\Client\Data\Parameter.cs" />
306+
<Compile Include="Models\Client\Data\RequestInfo.cs" />
307+
<Compile Include="Models\Client\Data\SimpleError.cs" />
308+
<Compile Include="Models\Client\Data\StackFrame.cs" />
309+
<Compile Include="Models\Client\Data\UserDescription.cs" />
310+
<Compile Include="Models\Client\Data\UserInfo.cs" />
311+
<Compile Include="Models\Client\Event.cs" />
312+
<Compile Include="Models\Collections\DataDictionary.cs" />
313+
<Compile Include="Models\Collections\GenericArguments.cs" />
314+
<Compile Include="Models\Collections\ModuleCollection.cs" />
315+
<Compile Include="Models\Collections\ObservableDictionary.cs" />
316+
<Compile Include="Models\Collections\ParameterCollection.cs" />
317+
<Compile Include="Models\Collections\SettingsDictionary.cs" />
318+
<Compile Include="Models\Collections\StackFrameCollection.cs" />
319+
<Compile Include="Models\Collections\TagSet.cs" />
320+
<Compile Include="Extensions\MethodExtensions.cs" />
321+
<Compile Include="Extensions\ParameterExtensions.cs" />
322+
<Compile Include="Extensions\RequestInfoExtensions.cs" />
323+
<Compile Include="Models\Interfaces\IData.cs" />
320324
<Compile Include="Polyfill\ConcurrentQueue.cs" />
321325
<Compile Include="Polyfill\ObjectPool.cs" />
322326
<Compile Include="Queue\IEventQueue.cs" />

Source/Shared/Newtonsoft.Json/Bson/BsonBinaryWriter.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void Flush()
5454

5555
public void Close()
5656
{
57-
#if !(NETFX_CORE || PORTABLE40 || PORTABLE)
57+
#if !(DOTNET || PORTABLE40 || PORTABLE)
5858
_writer.Close();
5959
#else
6060
_writer.Dispose();
@@ -142,9 +142,13 @@ private void WriteTokenInternal(BsonToken t)
142142
{
143143
DateTime dateTime = (DateTime)value.Value;
144144
if (DateTimeKindHandling == DateTimeKind.Utc)
145+
{
145146
dateTime = dateTime.ToUniversalTime();
147+
}
146148
else if (DateTimeKindHandling == DateTimeKind.Local)
149+
{
147150
dateTime = dateTime.ToLocalTime();
151+
}
148152

149153
ticks = DateTimeUtils.ConvertDateTimeToJavaScriptTicks(dateTime, false);
150154
}
@@ -186,14 +190,16 @@ private void WriteTokenInternal(BsonToken t)
186190
}
187191
break;
188192
default:
189-
throw new ArgumentOutOfRangeException("t", "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type));
193+
throw new ArgumentOutOfRangeException(nameof(t), "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type));
190194
}
191195
}
192196

193197
private void WriteString(string s, int byteCount, int? calculatedlengthPrefix)
194198
{
195199
if (calculatedlengthPrefix != null)
196-
_writer.Write(calculatedlengthPrefix.Value);
200+
{
201+
_writer.Write(calculatedlengthPrefix.GetValueOrDefault());
202+
}
197203

198204
WriteUtf8Bytes(s, byteCount);
199205

@@ -318,7 +324,7 @@ private int CalculateSize(BsonToken t)
318324
return value.CalculatedSize;
319325
}
320326
default:
321-
throw new ArgumentOutOfRangeException("t", "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type));
327+
throw new ArgumentOutOfRangeException(nameof(t), "Unexpected token when writing BSON: {0}".FormatWith(CultureInfo.InvariantCulture, t.Type));
322328
}
323329
}
324330
}

Source/Shared/Newtonsoft.Json/Bson/BsonObjectId.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ public class BsonObjectId
4545
/// <param name="value">The Oid value.</param>
4646
public BsonObjectId(byte[] value)
4747
{
48-
ValidationUtils.ArgumentNotNull(value, "value");
48+
ValidationUtils.ArgumentNotNull(value, nameof(value));
4949
if (value.Length != 12)
50-
throw new ArgumentException("An ObjectId must be 12 bytes", "value");
50+
{
51+
throw new ArgumentException("An ObjectId must be 12 bytes", nameof(value));
52+
}
5153

5254
Value = value;
5355
}

0 commit comments

Comments
 (0)