Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to 13.0.2, added pragmas #1902

Merged
merged 2 commits into from Jul 1, 2022
Merged

Conversation

brentschmaltz
Copy link
Member

Snapped to version 13.0.2.
The majority of the changes we #nullable enable as 13.0.2 uses nullable refs.
The other changes were suppressing warnings.

The changes in the source is the result of internal changes.
To see what those are you can compare these changes to the newtonsoft repo.

@@ -77,7 +80,12 @@ public override string Get(char[] key, int start, int length)
hashCode -= hashCode >> 5;

// make sure index is evaluated before accessing _entries, otherwise potential race condition causing IndexOutOfRangeException
var index = hashCode & _mask;
#if NET20 || NET35 || NET40
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NET35 || NET40

do we need these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need any of those defines

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are in the System.Threading and apply to all platforms we support.


if (CloseOutput && _writer != null)
{
#if HAVE_ASYNC_DISPOABLE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DISPOABLE

spelling: DISPOSABLE -> missing an S

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it, to be consistent with the repo, but the define in M.IM.Tokens.csproj was also misspelled.
So, i changed them both.

@@ -1,5 +1,5 @@

#if (DOTNET || PORTABLE40 || PORTABLE || NET_CORE)
#if (DOTNET || PORTABLE40 || PORTABLE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PORTABLE40 || PORTABLE

do we need these?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use NET_CORE in our test code, i don't think it is related to the product code, but i will add it back.
PORTABLE40 and PORTABLE are not defined in our builds, and are in many locations in the newtonsoft source.

@jennyf19
Copy link
Collaborator

jennyf19 commented Jul 1, 2022

using System;

missing license info


Refers to: src/Microsoft.IdentityModel.Tokens/opensource/json/Linq/JsonSelectSettings.cs:1 in 6f7d57b. [](commit_id = 6f7d57b, deletion_comment = False)

Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@TimHannMSFT
Copy link
Contributor

This and other files seem to be changed only in adding a trailing new line. Is that necessary?


Refers to: src/Microsoft.IdentityModel.Tokens/opensource/json/ConstructorHandling.cs:44 in 9934704. [](commit_id = 9934704, deletion_comment = False)

@@ -25,6 +25,8 @@

using System;

#nullable disable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable

Do you know why this is required here and elsewhere? This seems to be needed where nullable is enabled by default but then in the /json/ dir, there's #endable tags which make it seem as though it's disabled by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code is in the 13.0.2 branch and not in our last snapshot.

Copy link
Contributor

@TimHannMSFT TimHannMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@TimHannMSFT
Copy link
Contributor

Reviewed all the files for the first 3rd then spot checked the rest. LGTM

@brentschmaltz brentschmaltz merged commit 173179c into dev Jul 1, 2022
@@ -119,7 +128,7 @@ public string Add(string key)
hashCode -= hashCode >> 5;
for (Entry entry = _entries[hashCode & _mask]; entry != null; entry = entry.Next)
{
if (entry.HashCode == hashCode && entry.Value.Equals(key))
if (entry.HashCode == hashCode && entry.Value.Equals(key, StringComparison.Ordinal))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringComparison.Ordinal

The should not be necessary, the default is StringComparison.Ordinal already.

@@ -158,7 +167,12 @@ private void Grow()
}
}
_entries = newEntries;
_mask = newMask;

#if NET20 || NET35 || NET40
Copy link
Contributor

@dannybtsai dannybtsai Jul 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like read, we probably don't need this, maybe just use Volatile.Write()?

@brentschmaltz brentschmaltz deleted the brentsch/newtonsoftUpdate branch August 24, 2022 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants