code cleanup
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/83a760c3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/83a760c3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/83a760c3 Branch: refs/heads/ignite-2324 Commit: 83a760c3833b91a55f3d9aa6f93b9b1b34dc9708 Parents: d8a958a Author: Pavel Tupitsyn <ptupit...@gridgain.com> Authored: Wed Jan 13 16:57:45 2016 +0300 Committer: Pavel Tupitsyn <ptupit...@gridgain.com> Committed: Wed Jan 13 16:57:45 2016 +0300 ---------------------------------------------------------------------- modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs | 3 +-- .../platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs | 2 +- .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs | 2 +- .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs | 4 ++++ .../Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs | 1 + .../Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs | 1 + .../dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs | 1 + .../Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs | 2 +- 8 files changed, 11 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs index 7a3fafc..3a27ad1 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Ignition.cs @@ -148,8 +148,7 @@ namespace Apache.Ignite.Core var gridName = cfgEx != null ? cfgEx.GridName : null; - var cfgPath = Environment.GetEnvironmentVariable(EnvIgniteSpringConfigUrlPrefix) + - (cfg.SpringConfigUrl ?? DefaultCfg); + var cfgPath = Environment.GetEnvironmentVariable(EnvIgniteSpringConfigUrlPrefix) + cfg.SpringConfigUrl; // 3. Create startup object which will guide us through the rest of the process. _startup = new Startup(cfg, cbs); http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs index a261e18..e96720e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs @@ -187,7 +187,7 @@ namespace Apache.Ignite.Core.Impl.Binary /// <returns>Empty binary object.</returns> private BinaryObject BinaryFromDescriptor(IBinaryTypeDescriptor desc) { - var len = BinaryObjectHeader.Size; + const int len = BinaryObjectHeader.Size; var hdr = new BinaryObjectHeader(desc.TypeId, 0, len, 0, len, desc.UserType ? BinaryObjectHeader.Flag.UserType : BinaryObjectHeader.Flag.None); http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs index 1c85e31..41bd284 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryUtils.cs @@ -1125,7 +1125,7 @@ namespace Apache.Ignite.Core.Impl.Binary res = factory.Invoke(len); if (adder == null) - adder = (col, elem) => { ((ArrayList) col).Add(elem); }; + adder = (col, elem) => ((ArrayList) col).Add(elem); for (int i = 0; i < len; i++) adder.Invoke(res, ctx.Deserialize<object>()); http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs index 189cd50..0810891 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs @@ -803,6 +803,7 @@ namespace Apache.Ignite.Core.Impl.Binary /// <param name="val">Enum value.</param> public void WriteEnum<T>(T val) { + // ReSharper disable once CompareNonConstrainedGenericWithNull if (val == null) WriteNullField(); else @@ -879,6 +880,7 @@ namespace Apache.Ignite.Core.Impl.Binary { WriteFieldId(fieldName, BinaryUtils.TypeObject); + // ReSharper disable once CompareNonConstrainedGenericWithNull if (val == null) WriteNullField(); else @@ -1044,6 +1046,7 @@ namespace Apache.Ignite.Core.Impl.Binary _stream = stream; } + /// <summary> /// Write object. /// </summary> @@ -1051,6 +1054,7 @@ namespace Apache.Ignite.Core.Impl.Binary public void Write<T>(T obj) { // Handle special case for null. + // ReSharper disable once CompareNonConstrainedGenericWithNull if (obj == null) { _stream.WriteByte(BinaryUtils.HdrNull); http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs index 29ec642..66ee695 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerBatch.cs @@ -192,6 +192,7 @@ namespace Apache.Ignite.Core.Impl.Datastream { curBatch._fut.Get(); } + // ReSharper disable once EmptyGeneralCatchClause catch (Exception) { // Ignore. http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs index 3686ecb..e2b3d13 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Datastream/DataStreamerImpl.cs @@ -537,6 +537,7 @@ namespace Apache.Ignite.Core.Impl.Datastream if (_batch != null) _batch.Send(this, PlcCancelClose); } + // ReSharper disable once EmptyGeneralCatchClause catch (Exception) { // Finalizers should never throw http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs index 1979086..e18970f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/HandleRegistry.cs @@ -211,6 +211,7 @@ namespace Apache.Ignite.Core.Impl.Handle { target0.Release(); } + // ReSharper disable once EmptyGeneralCatchClause catch (Exception) { // No-op. http://git-wip-us.apache.org/repos/asf/ignite/blob/83a760c3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs index e554cfc..685ccd9 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs @@ -275,7 +275,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged if (_ignite != null) cacheStore.Init(_ignite); else - _initActions.Add(g => cacheStore.Init(g)); + _initActions.Add(cacheStore.Init); } }