From: Atsushi Kanamori Date: Wed, 26 Jul 2017 17:39:10 +0000 (-0700) Subject: Remove catch filter on Assembly.GetForwardedTypes() (#13054) X-Git-Tag: accepted/tizen/base/20180629.140029~1083^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed71880722e94c348971e89d8953d8059137150e;p=platform%2Fupstream%2Fcoreclr.git Remove catch filter on Assembly.GetForwardedTypes() (#13054) To be more consistent with Assembly.GetTypes() Also removed left over "unsafe" keyword that's no longer needed. --- diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index 76f7917..cd9c715 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -821,7 +821,7 @@ namespace System.Reflection if (type == null) continue; // mdtExternalType was not a forwarder entry. } - catch (Exception e) when (IsLoaderException(e)) + catch (Exception e) { type = null; exception = e; @@ -859,7 +859,7 @@ namespace System.Reflection { nestedTypes = type.GetNestedTypes(BindingFlags.Public); } - catch (Exception e) when (IsLoaderException(e)) + catch (Exception e) { exceptions.Add(e); return; @@ -871,13 +871,8 @@ namespace System.Reflection } } - private static bool IsLoaderException(Exception e) - { - return e is FileLoadException || e is FileNotFoundException || e is TypeLoadException || e is IOException || e is UnauthorizedAccessException; - } - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [SuppressUnmanagedCodeSecurity] - private static unsafe extern void GetForwardedType(RuntimeAssembly assembly, MetadataToken mdtExternalType, ObjectHandleOnStack type); + private static extern void GetForwardedType(RuntimeAssembly assembly, MetadataToken mdtExternalType, ObjectHandleOnStack type); } }