Skip to content

Fix behavior ObjectCollection for single item contains - #59547

Merged
hoyosjs merged 2 commits into
dotnet:mainfrom
hoyosjs:juhoyosa/fix-object-collection-single-item
Sep 24, 2021
Merged

Fix behavior ObjectCollection for single item contains#59547
hoyosjs merged 2 commits into
dotnet:mainfrom
hoyosjs:juhoyosa/fix-object-collection-single-item

Conversation

@hoyosjs

@hoyosjshoyosjs commented Sep 23, 2021

Copy link
Copy Markdown
Member

Contains for a single item performs a reference-equals, not a semantic equality comparison. Change to use the item's equality definition.

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Contains for a signle item performs a reference-equals, not a semantic equality comparison. Change to use the item's equality definition.

Author:hoyosjs
Assignees:-
Labels:

area-System.Net

Milestone:-

@geoffkizer

Copy link
Copy Markdown
Contributor

It looks like we have a similar issue here: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs#L123

I don't see any other instances of this in the file, but a second pair of eyeballs would be good...

@hoyosjs

hoyosjs commented Sep 23, 2021

Copy link
Copy Markdown
MemberAuthor

It looks like we have a similar issue here: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ObjectCollection.cs#L123

I don't see any other instances of this in the file, but a second pair of eyeballs would be good...

Noticed that too - there's a few https://source.dot.net/#System.Net.Http/System/Net/Http/Headers/ContentDispositionHeaderValue.cs,104 and in setting date and name in ContentDisposition

@hoyosjs
hoyosjsforce-pushed the juhoyosa/fix-object-collection-single-item branch from 79ef90c to d71f442CompareSeptember 23, 2021 23:13
@runfoapprunfoappBot mentioned this pull request Sep 24, 2021
@hoyosjs

Copy link
Copy Markdown
MemberAuthor

/backport to release/6.0-rc2

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/6.0-rc2: https://github.com/dotnet/runtime/actions/runs/1268272160

@hoyosjs

Copy link
Copy Markdown
MemberAuthor

@stephentoub@geoffkizer can you please take a look here and if everything looks OK now approve this and the port? Don't want to keep RC2 in delay.

@stephentoubstephentoub left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks.

@hoyosjs
hoyosjs merged commit 49f22ce into dotnet:mainSep 24, 2021
@hoyosjs
hoyosjs deleted the juhoyosa/fix-object-collection-single-item branch September 24, 2021 20:35
@ghostghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hoyosjs@geoffkizer@stephentoub@karelz