IGNITE-2324: Review.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8ec03ff3 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8ec03ff3 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8ec03ff3 Branch: refs/heads/ignite-2324 Commit: 8ec03ff31263619cf0d1177d5e25c70600e333a5 Parents: f1d9652 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Mon Jan 18 17:11:27 2016 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Mon Jan 18 17:11:27 2016 +0300 ---------------------------------------------------------------------- .../Apache.Ignite.Core/Cache/CachePartialUpdateException.cs | 4 ++-- .../Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs | 1 - .../Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs | 7 +++---- .../dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs | 4 ++-- .../Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs | 5 ++--- .../dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs | 5 ++--- .../dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs | 5 ++--- .../platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs | 4 ++-- .../platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs | 1 - .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs | 1 + .../dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs | 1 - .../dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs | 1 + .../platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs | 1 - .../dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs | 1 - .../platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs | 1 - .../Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs | 1 - .../Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs | 1 - 17 files changed, 17 insertions(+), 27 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Cache/CachePartialUpdateException.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/CachePartialUpdateException.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/CachePartialUpdateException.cs index 25ed42c..b80913f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/CachePartialUpdateException.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/CachePartialUpdateException.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cache { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.Serialization; using Apache.Ignite.Core.Impl.Common; @@ -110,10 +111,9 @@ namespace Apache.Ignite.Core.Cache } /** <inheritdoc /> */ + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public override void GetObjectData(SerializationInfo info, StreamingContext context) { - IgniteArgumentCheck.NotNull(info, "info"); - info.AddValue(KeyFailedKeys, _failedKeys); base.GetObjectData(info, context); http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs index dd19620..853619d 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Event/ICacheEntryEventFilter.cs @@ -15,7 +15,6 @@ * limitations under the License. */ - namespace Apache.Ignite.Core.Cache.Event { /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs index d9ad024..3f3b558 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Store/CacheStoreAdapter.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Cache.Store { using System; using System.Collections; + using System.Diagnostics.CodeAnalysis; using System.Linq; using Apache.Ignite.Core.Impl.Common; @@ -73,10 +74,9 @@ namespace Apache.Ignite.Core.Cache.Store /// Writes all. /// </summary> /// <param name="entries">The map.</param> + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public virtual void WriteAll(IDictionary entries) { - IgniteArgumentCheck.NotNull(entries, "entries"); - foreach (DictionaryEntry entry in entries) Write(entry.Key, entry.Value); } @@ -98,10 +98,9 @@ namespace Apache.Ignite.Core.Cache.Store /// <param name="keys">a mutable collection of keys for entries to delete. Upon invocation, /// it contains the keys to delete for write-through. Upon return the collection must only contain /// the keys that were not successfully deleted.</param> + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public virtual void DeleteAll(ICollection keys) { - IgniteArgumentCheck.NotNull(keys, "keys"); - foreach (object key in keys) Delete(key); } http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs index efd2778..f2d2e14 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskAdapter.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Compute { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl.Common; @@ -43,11 +44,10 @@ namespace Apache.Ignite.Core.Compute /// <param name="res">Received remote Ignite executable result.</param> /// <param name="rcvd">All previously received results.</param> /// <returns>Result policy that dictates how to process further upcoming job results.</returns> + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public virtual ComputeJobResultPolicy OnResult(IComputeJobResult<TJobRes> res, IList<IComputeJobResult<TJobRes>> rcvd) { - IgniteArgumentCheck.NotNull(res, "res"); - Exception err = res.Exception; if (err != null) http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs index a09c132..bc152b5 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Compute/ComputeTaskSplitAdapter.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Compute { using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl; @@ -61,11 +62,9 @@ namespace Apache.Ignite.Core.Compute /// exception will be thrown. /// </returns> /// <exception cref="IgniteException">Split returned no jobs.</exception> + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] override public IDictionary<IComputeJob<TJobRes>, IClusterNode> Map(IList<IClusterNode> subgrid, TArg arg) { - IgniteArgumentCheck.NotNull(subgrid, "subgrid"); - IgniteArgumentCheck.Ensure(subgrid.Count > 0, "subgrid", "subgrid should not be empty"); - var jobs = Split(subgrid.Count, arg); if (jobs == null || jobs.Count == 0) http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs index dcdf6d6..1735c3b 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamTransformer.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Datastream { using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Impl.Binary; @@ -50,11 +51,9 @@ namespace Apache.Ignite.Core.Datastream } /** <inheritdoc /> */ + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public void Receive(ICache<TK, TV> cache, ICollection<ICacheEntry<TK, TV>> entries) { - IgniteArgumentCheck.NotNull(cache, "cache"); - IgniteArgumentCheck.NotNull(entries, "entries"); - var keys = new List<TK>(entries.Count); foreach (var entry in entries) http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs index f5990b6..071f7a3 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Datastream/StreamVisitor.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Datastream { using System; using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cache; using Apache.Ignite.Core.Impl.Common; @@ -46,11 +47,9 @@ namespace Apache.Ignite.Core.Datastream } /** <inheritdoc /> */ + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] public void Receive(ICache<TK, TV> cache, ICollection<ICacheEntry<TK, TV>> entries) { - IgniteArgumentCheck.NotNull(cache, "cache"); - IgniteArgumentCheck.NotNull(entries, "entries"); - foreach (var entry in entries) _action(cache, entry); } http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs index 4bc4c35..962d577 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Events/EventBase.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Events { using System; using System.Diagnostics; + using System.Diagnostics.CodeAnalysis; using System.Globalization; using Apache.Ignite.Core.Binary; using Apache.Ignite.Core.Cluster; @@ -203,10 +204,9 @@ namespace Apache.Ignite.Core.Events /// </summary> /// <param name="reader">Reader.</param> /// <returns>Node or null.</returns> + [SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods")] protected static IClusterNode ReadNode(IBinaryRawReader reader) { - IgniteArgumentCheck.NotNull(reader, "reader"); - return ((BinaryReader)reader).Marshaller.Ignite.GetNode(reader.ReadGuid()); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/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 7163486..efe1df4 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/Binary.cs @@ -50,7 +50,6 @@ namespace Apache.Ignite.Core.Impl.Binary using (var stream = new BinaryHeapStream(1024)) { - // Serialize. BinaryWriter writer = _marsh.StartMarshal(stream); http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs index 2f68a0a..7aaaaa5 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryObject.cs @@ -146,6 +146,7 @@ namespace Apache.Ignite.Core.Impl.Binary if (_deserialized == null) { T res; + using (IBinaryStream stream = new BinaryHeapStream(_data)) { stream.Seek(_offset, SeekOrigin.Begin); http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/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 0810891..a7ce544 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Binary/BinaryWriter.cs @@ -1046,7 +1046,6 @@ namespace Apache.Ignite.Core.Impl.Binary _stream = stream; } - /// <summary> /// Write object. /// </summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs index 325d429..f55863e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs @@ -1037,6 +1037,7 @@ namespace Apache.Ignite.Core.Impl.Cache catch (Exception) { hnd.Dispose(); + throw; } } http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs index cd42c36..7e6f418 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/Future.cs @@ -15,7 +15,6 @@ * limitations under the License. */ -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member namespace Apache.Ignite.Core.Impl.Common { using System; http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs index c9a4852..c9f1555 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/FutureType.cs @@ -15,7 +15,6 @@ * limitations under the License. */ -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member namespace Apache.Ignite.Core.Impl.Common { using System.Diagnostics.CodeAnalysis; http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs index 1cf0512..0168963 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Handle/Handle.cs @@ -15,7 +15,6 @@ * limitations under the License. */ -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member namespace Apache.Ignite.Core.Impl.Handle { using System; http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs index 4c0dbcc..ba0da19 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Memory/PlatformMemoryStream.cs @@ -15,7 +15,6 @@ * limitations under the License. */ -#pragma warning disable 1591 // Missing XML comment for publicly visible type or member namespace Apache.Ignite.Core.Impl.Memory { using System; http://git-wip-us.apache.org/repos/asf/ignite/blob/8ec03ff3/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs index 714e639..229ff8c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs @@ -90,7 +90,6 @@ namespace Apache.Ignite.Core.Impl.Transactions return TxStart(concurrency, isolation, _dfltTimeout, 0); } - /** <inheritDoc /> */ [SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")] public ITransaction TxStart(TransactionConcurrency concurrency, TransactionIsolation isolation,