-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Annotate System.Net.Http for nullable #33268
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
d63ba3d
Annotate System.Net.Http for nullable
buyaa-n 9f41541
Remainder annotations and ref assembly annotation
buyaa-n 269d682
Merge conflict
buyaa-n 53efe81
Adding some #nullable enable
buyaa-n 0f45a9b
Apply feedback
buyaa-n 03281b5
Linix OSX build fix, review udpate
buyaa-n 859cd61
Ignore annotations for System.Net.Http.WinHttpHandler
buyaa-n f937c89
Merging conflict
buyaa-n b163a82
Ignore annotations for Common.Tests.csproj
buyaa-n a806d5d
Ignore annotations for System.Net.Http.WinHttpHandler.Unit.Tests.csproj
buyaa-n 34288f5
Merge branch 'master' of https://github.com/dotnet/runtime into net_http
buyaa-n 75177b8
Applying feedback
buyaa-n 57f58e9
Merging conflict
buyaa-n ef0e8fb
Address review comment, fix unit test build
buyaa-n 9209320
Address feedback
buyaa-n 52c2205
Merge branch 'master' of https://github.com/dotnet/runtime into net_http
buyaa-n 9f5416e
Add #nullable enable for files refeerenced from AspNetCore
buyaa-n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| #nullable enable | ||
| using System.Buffers; | ||
| using System.Diagnostics; | ||
| using System.Net.Http.HPack; | ||
|
|
@@ -118,7 +119,7 @@ private enum State | |
| private bool _huffman; | ||
| private int? _index; | ||
|
|
||
| private byte[] _headerName; | ||
| private byte[]? _headerName; | ||
| private int _headerNameLength; | ||
| private int _headerValueLength; | ||
| private int _stringLength; | ||
|
|
@@ -130,7 +131,7 @@ private enum State | |
| private static void ReturnAndGetNewPooledArray(ref byte[] buffer, int newSize) | ||
| { | ||
| byte[] old = buffer; | ||
| buffer = null; | ||
| buffer = null!; | ||
|
|
||
| Pool.Return(old, clearArray: true); | ||
| buffer = Pool.Rent(newSize); | ||
|
|
@@ -151,19 +152,19 @@ public void Dispose() | |
| if (_stringOctets != null) | ||
| { | ||
| Pool.Return(_stringOctets, true); | ||
| _stringOctets = null; | ||
| _stringOctets = null!; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder the pattern. If it is important why doesn't Pool.Return() assign the null? |
||
| } | ||
|
|
||
| if (_headerNameOctets != null) | ||
| { | ||
| Pool.Return(_headerNameOctets, true); | ||
| _headerNameOctets = null; | ||
| _headerNameOctets = null!; | ||
| } | ||
|
|
||
| if (_headerValueOctets != null) | ||
| { | ||
| Pool.Return(_headerValueOctets, true); | ||
| _headerValueOctets = null; | ||
| _headerValueOctets = null!; | ||
| } | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.