ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptupit...@apache.org
Subject ignite git commit: IGNITE-6404 Fix failures in .NET (NPE in ExceptionUtils, inspections)
Date Mon, 18 Sep 2017 09:57:36 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 64b4abe52 -> 22002141a


IGNITE-6404 Fix failures in .NET (NPE in ExceptionUtils, inspections)


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/22002141
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/22002141
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/22002141

Branch: refs/heads/master
Commit: 22002141a1d594556f1b72fa0dd139ab0a1414aa
Parents: 64b4abe
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Mon Sep 18 12:57:26 2017 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Mon Sep 18 12:57:26 2017 +0300

----------------------------------------------------------------------
 .../Client/Cache/ICacheClient.cs                |  1 +
 .../Apache.Ignite.Core/Impl/ExceptionUtils.cs   | 20 +++++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/22002141/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
index b4cd3c5..b8bd6fe 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Client/Cache/ICacheClient.cs
@@ -22,6 +22,7 @@ namespace Apache.Ignite.Core.Client.Cache
     /// <summary>
     /// Client cache API. See <see cref="IIgniteClient.GetCache{K, V}"/>.
     /// </summary>
+    // ReSharper disable once TypeParameterCanBeVariant (ICache shoul not be variant, more
methods will be added)
     public interface ICacheClient<TK, TV>
     {
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/22002141/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
index aa28073..b81d04b 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/ExceptionUtils.cs
@@ -115,19 +115,21 @@ namespace Apache.Ignite.Core.Impl
         /// <summary>
         /// Creates exception according to native code class and message.
         /// </summary>
-        /// <param name="ignite">The ignite.</param>
+        /// <param name="igniteInt">The ignite.</param>
         /// <param name="clsName">Exception class name.</param>
         /// <param name="msg">Exception message.</param>
         /// <param name="stackTrace">Native stack trace.</param>
         /// <param name="reader">Error data reader.</param>
         /// <param name="innerException">Inner exception.</param>
         /// <returns>Exception.</returns>
-        public static Exception GetException(IIgniteInternal ignite, string clsName, string
msg, string stackTrace,
+        public static Exception GetException(IIgniteInternal igniteInt, string clsName, string
msg, string stackTrace,
             BinaryReader reader = null, Exception innerException = null)
         {
             // Set JavaException as immediate inner.
             innerException = new JavaException(clsName, msg, stackTrace, innerException);
 
+            var ignite = igniteInt == null ? null : igniteInt.GetIgnite();
+
             ExceptionFactory ctor;
 
             if (Exs.TryGetValue(clsName, out ctor))
@@ -139,11 +141,11 @@ namespace Apache.Ignite.Core.Impl
                 if (match.Success && Exs.TryGetValue(match.Groups[1].Value, out innerCtor))
                 {
                     return ctor(clsName, msg,
-                        innerCtor(match.Groups[1].Value, match.Groups[2].Value, innerException,
ignite.GetIgnite()), 
-                        ignite.GetIgnite());
+                        innerCtor(match.Groups[1].Value, match.Groups[2].Value, innerException,
ignite), 
+                        ignite);
                 }
 
-                return ctor(clsName, msg, innerException, ignite.GetIgnite());
+                return ctor(clsName, msg, innerException, ignite);
             }
 
             if (ClsNoClsDefFoundErr.Equals(clsName, StringComparison.OrdinalIgnoreCase))
@@ -155,16 +157,16 @@ namespace Apache.Ignite.Core.Impl
                     "variable?): " + msg, innerException);
 
             if (ClsCachePartialUpdateErr.Equals(clsName, StringComparison.OrdinalIgnoreCase))
-                return ProcessCachePartialUpdateException(ignite, msg, stackTrace, reader);
+                return ProcessCachePartialUpdateException(igniteInt, msg, stackTrace, reader);
 
             // Predefined mapping not found - check plugins.
-            if (ignite != null && ignite.PluginProcessor != null)
+            if (igniteInt != null && igniteInt.PluginProcessor != null)
             {
-                ctor = ignite.PluginProcessor.GetExceptionMapping(clsName);
+                ctor = igniteInt.PluginProcessor.GetExceptionMapping(clsName);
 
                 if (ctor != null)
                 {
-                    return ctor(clsName, msg, innerException, ignite.GetIgnite());
+                    return ctor(clsName, msg, innerException, ignite);
                 }
             }
 


Mime
View raw message