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

Key item added to KeyNotFoundException #15201

Merged
merged 1 commit into from Nov 24, 2017

Conversation

Projects
None yet
4 participants
@Anipik
Copy link
Member

Anipik commented Nov 23, 2017

@Anipik Anipik requested a review from danmosemsft Nov 23, 2017

@Anipik Anipik changed the title Added Key in KeyNotFoundException Key item added to KeyNotFoundException Nov 23, 2017

@Anipik

This comment has been minimized.

Copy link
Member Author

Anipik commented Nov 24, 2017

@dotnet-bot test CentOS7.1 x64 Checked Innerloop Build and Test

@danmosemsft

This comment has been minimized.

Copy link
Member

danmosemsft commented Nov 24, 2017

LGTM

@danmosemsft danmosemsft merged commit db342eb into dotnet:master Nov 24, 2017

14 of 15 checks passed

CentOS7.1 x64 Checked Innerloop Build and Test Build finished.
Details
CROSS Check Build finished.
Details
CentOS7.1 x64 Debug Innerloop Build Build finished.
Details
OSX10.12 x64 Checked Innerloop Build and Test Build finished.
Details
Tizen armel Cross Checked Innerloop Build and Test Build finished.
Details
Ubuntu arm64 Cross Debug Innerloop Build Build finished.
Details
Ubuntu armlb Cross Debug Innerloop Build Build finished.
Details
Ubuntu x64 Checked Innerloop Build and Test Build finished.
Details
Ubuntu x64 Innerloop Formatting Build finished.
Details
Ubuntu16.04 armlb Cross Debug Innerloop Build Build finished.
Details
WIP ready for review
Details
Windows_NT x64 Checked Innerloop Build and Test Build finished.
Details
Windows_NT x64 Innerloop Formatting Build finished.
Details
Windows_NT x86 Checked Innerloop Build and Test Build finished.
Details
license/cla All CLA requirements met.
Details

dotnet-bot added a commit to dotnet/corert that referenced this pull request Nov 24, 2017

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

dotnet-bot added a commit to dotnet/corefx that referenced this pull request Nov 24, 2017

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
{
throw new KeyNotFoundException();
throw new KeyNotFoundException(key.ToString());

This comment has been minimized.

@jkotas

jkotas Nov 25, 2017

Member

@Anipik This needs to use SR.Format(SR.Arg_KeyNotFoundWithKey, key.ToString()) to get the proper error message.

Also, this may need to be split into the Throw + Get...Exception method pair like the other similar methods in this file to allow JIT to generate better code for it.

This comment has been minimized.

@Anipik

Anipik Nov 27, 2017

Author Member

isn't both throw + get already separated as we have ThrowKeyNotFoundException(object key) and KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, key.ToString())); functions

This comment has been minimized.

@jkotas

jkotas Nov 27, 2017

Member

Separating it even more has additional benefits - check the discussion in #7580 that introduced it.

@danmosemsft

This comment has been minimized.

Copy link
Member

danmosemsft commented Nov 25, 2017

@brianrob I should have asked @Anipik to wait on your review. Is the change OK?

@@ -426,6 +426,9 @@
</data>
<data name="Arg_KeyNotFound" xml:space="preserve">
<value>The given key was not present in the dictionary.</value>
</data>
<data name="Arg_KeyNotFoundWithKey" xml:space="preserve">
<value>The given key '{0}' was not present in the dictionary.</value>

This comment has been minimized.

@danmosemsft

danmosemsft Nov 25, 2017

Member

Indenting issue here.

jkotas added a commit to dotnet/corert that referenced this pull request Nov 25, 2017

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>

danmosemsft added a commit to dotnet/corefx that referenced this pull request Nov 25, 2017

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
@brianrob

This comment has been minimized.

Copy link
Member

brianrob commented Nov 27, 2017

@danmosemsft, this change is fine. However, it is going to break CoreFX and CoreRT because the use of the string is in the shared directory but the string definition is not. So, the string change needs to be ported to both corefx and corert.

@danmosemsft

This comment has been minimized.

Copy link
Member

danmosemsft commented Nov 27, 2017

@Anipik note you have feedback above to address.

@Anipik

This comment has been minimized.

Copy link
Member Author

Anipik commented Nov 27, 2017

@brianrob dotnet/corefx#25472 contains the changes for the issue. Are they sufficient or we require to change anything else in corefx ?

@brianrob

This comment has been minimized.

Copy link
Member

brianrob commented Nov 27, 2017

@Anipik, corefx was fixed because the change came in via the mirror and @danmosemsft added 9a5f587 to it.

It looks like @jkotas fixed corert via da979a318e7d39498895365c60eb4a0c88d2a1d3 so I think you're good to go.

@Anipik Anipik deleted the Anipik:keynotfound branch Dec 13, 2017

dotnet-bot added a commit to dotnet/corefx that referenced this pull request Jan 13, 2018

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>

dotnet-bot added a commit to dotnet/corefx that referenced this pull request Jan 13, 2018

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>

safern added a commit to dotnet/corefx that referenced this pull request Jan 16, 2018

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>

safern added a commit to dotnet/corefx that referenced this pull request Jan 16, 2018

added keu value to key not found exception (dotnet/coreclr#15201)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment