From: Atsushi Kanamori Date: Sat, 18 Mar 2017 22:15:43 +0000 (-0700) Subject: Fix for Module.GetMethod(string) (dotnet/coreclr#10283) X-Git-Tag: submit/tizen/20210909.063632~11030^2~7657 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb42a281773ef193277f14e7988647a4638e466c;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix for Module.GetMethod(string) (dotnet/coreclr#10283) Commit migrated from https://github.com/dotnet/coreclr/commit/f22e55bf30580c4e518aaf1c94c31e79297370c6 --- diff --git a/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs b/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs index 53cd63a..0b78c9d 100644 --- a/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs +++ b/src/coreclr/src/mscorlib/src/System/Reflection/Module.cs @@ -28,7 +28,14 @@ namespace System.Reflection public virtual object[] GetCustomAttributes(bool inherit) { throw NotImplemented.ByDesign; } public virtual object[] GetCustomAttributes(Type attributeType, bool inherit) { throw NotImplemented.ByDesign; } - public MethodInfo GetMethod(string name) => GetMethod(name, null); + public MethodInfo GetMethod(string name) + { + if (name == null) + throw new ArgumentNullException(nameof(name)); + + return GetMethodImpl(name, Module.DefaultLookup, null, CallingConventions.Any, null, null); + } + public MethodInfo GetMethod(string name, Type[] types) => GetMethod(name, Module.DefaultLookup, null, CallingConventions.Any, types, null); public MethodInfo GetMethod(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) {