Make Exception._HResult private (dotnet/coreclr#22354)
authorJan Kotas <jkotas@microsoft.com>
Sat, 2 Feb 2019 03:47:52 +0000 (19:47 -0800)
committerGitHub <noreply@github.com>
Sat, 2 Feb 2019 03:47:52 +0000 (19:47 -0800)
Commit migrated from https://github.com/dotnet/coreclr/commit/c6db4c75edf52b9a7b2875e94485630fc962d9bf

src/coreclr/src/System.Private.CoreLib/src/System/Exception.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/IVectorViewToIReadOnlyListAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs
src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs

index 2ac88f6..e0266a9 100644 (file)
@@ -622,7 +622,7 @@ namespace System
 #pragma warning restore 414
 
         // @MANAGED: HResult is used from within the EE!  Rename with care - check VM directory
-        internal int _HResult;     // HResult
+        private int _HResult;       // HResult
 
         public int HResult
         {
@@ -668,7 +668,7 @@ namespace System
         {
             get
             {
-                return nIsTransient(_HResult);
+                return nIsTransient(HResult);
             }
         }
 
index f14aaa6..6542f5c 100644 (file)
@@ -165,7 +165,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -183,7 +183,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -201,7 +201,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -219,7 +219,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
index 93b7cdd..6771151 100644 (file)
@@ -331,7 +331,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
                 catch (InvalidCastException elementCastException)
                 {
                     Exception e = new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueArrayCoersion, this.Type, typeof (T).MakeArrayType().Name, i, elementCastException.Message), elementCastException);
-                    e.HResult = elementCastException._HResult;
+                    e.HResult = elementCastException.HResult;
                     throw e;
                 }
             }
index 674bb51..3a80860 100644 (file)
@@ -90,7 +90,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)  // Still may hit this case due to a race condition
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                 {
                     value = default;
                     return false;
@@ -111,7 +111,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new KeyNotFoundException(SR.Format(SR.Arg_KeyNotFoundWithKey, key.ToString()));
                 throw;
             }
index 83889d0..f6667ac 100644 (file)
@@ -50,7 +50,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
index 4f674fe..8bd2020 100644 (file)
@@ -109,7 +109,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     return false;
 
                 throw;
@@ -153,7 +153,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new KeyNotFoundException(SR.Arg_KeyNotFound);
                 throw;
             }
index ee2c7df..18c3596 100644 (file)
@@ -102,7 +102,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -120,7 +120,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -138,7 +138,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
@@ -156,7 +156,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
             }
             catch (Exception ex)
             {
-                if (HResults.E_BOUNDS == ex._HResult)
+                if (HResults.E_BOUNDS == ex.HResult)
                     throw new ArgumentOutOfRangeException(nameof(index));
 
                 throw;
index d9d229b..330bfe7 100644 (file)
@@ -1386,7 +1386,7 @@ namespace System.StubHelpers
             if (ex == null)
                 return 0;  // S_OK;
 
-            return ex._HResult;
+            return ex.HResult;
         }
 
         internal static Exception ConvertToManaged(int hr)