From ed71880722e94c348971e89d8953d8059137150e Mon Sep 17 00:00:00 2001 From: Atsushi Kanamori Date: Wed, 26 Jul 2017 10:39:10 -0700 Subject: [PATCH] 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. --- src/mscorlib/src/System/Reflection/RuntimeAssembly.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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); } } -- 2.7.4