Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

hughbe
Copy link

@hughbe hughbe commented Jan 27, 2016

Found one weird parameter name, and git grepped the mscorlib folder to fix the others

@AlgorithmsAreCool
Copy link

Is it still to soon to use nameof() in coreclr?

@hughbe
Copy link
Author

hughbe commented Feb 23, 2016

I think it's corefx only at the moment

@@ -36,7 +36,7 @@ public abstract class FieldInfo : MemberInfo, _FieldInfo
public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle)
{
if (handle.IsNullHandle())
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"));
throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"), "handle");
Copy link

Choose a reason for hiding this comment

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

Are these parameters backwards i.e. shouldn't "handle" come before the GetResourceString call?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think so, as this is an ArgumentException

Copy link

Choose a reason for hiding this comment

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

Nvm, just looked it up and the order is reversed for ArgumentException. That's confusing.

Copy link
Author

Choose a reason for hiding this comment

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

Very! Stumped me more than a few times

@ianhays
Copy link

ianhays commented Apr 8, 2016

Changes look good to me.

Fixed several ArgumentNullExceptions that throw with the message as the parameter name, leading to potential confusion for developers.
@hughbe
Copy link
Author

hughbe commented May 10, 2016

@jkotas please take a look, this has been reviewed but unmerged for a while :)

@jkotas
Copy link
Member

jkotas commented May 10, 2016

LGTM. Thanks! Sorry for the delay.

Would you mind porting the applicable fixes to CoreRT as well?

@jkotas jkotas merged commit ad2485b into dotnet:master May 10, 2016
@hughbe
Copy link
Author

hughbe commented May 10, 2016

Will do

@hughbe hughbe deleted the string-exception branch May 10, 2016 15:07
jkotas pushed a commit to dotnet/corert that referenced this pull request May 10, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…coreclr#2889)

Fixed several ArgumentNullExceptions that throw with the message as the parameter name, leading to potential confusion for developers.

Commit migrated from dotnet/coreclr@ad2485b
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants