Repository: ignite Updated Branches: refs/heads/ignite-1282 f6111b559 -> b9256a1e7
http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/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 9efaf5f..3938d35 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs @@ -1052,6 +1052,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged #region HELPERS + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private void SafeCall(Action func, bool allowUnitialized = false) { if (!allowUnitialized) @@ -1067,6 +1068,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged } } + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] private T SafeCall<T>(Func<T> func, bool allowUnitialized = false) { if (!allowUnitialized) http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs index 24db5a5..fe2de77 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedNonReleaseableTarget.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged { using System; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Unmanaged target which does not require explicit release. @@ -60,6 +61,8 @@ namespace Apache.Ignite.Core.Impl.Unmanaged } /** <inheritdoc /> */ + [SuppressMessage("Microsoft.Usage", "CA1816:CallGCSuppressFinalizeCorrectly", + Justification = "There is no finalizer.")] public void Dispose() { // No-op. http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs index c55d92f..34da332 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedUtils.cs @@ -19,6 +19,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged { using System; using System.Diagnostics.CodeAnalysis; + using System.Globalization; using System.Runtime.InteropServices; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl.Common; @@ -403,6 +404,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged /// Initializer. /// </summary> [SuppressMessage("Microsoft.Design", "CA1065:DoNotRaiseExceptionsInUnexpectedLocations")] + [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static UnmanagedUtils() { var path = IgniteUtils.UnpackEmbeddedResource(IgniteUtils.FileIgniteJniDll); @@ -1253,9 +1255,13 @@ namespace Apache.Ignite.Core.Impl.Unmanaged var procPtr = NativeMethods.GetProcAddress(Ptr, procName); if (procPtr == IntPtr.Zero) - throw new IgniteException(string.Format("Unable to find native function: {0} (Error code: {1}). " + - "Make sure that module.def is up to date", - procName, Marshal.GetLastWin32Error())); + { + var error = Marshal.GetLastWin32Error(); + + throw new IgniteException(string.Format(CultureInfo.InvariantCulture, + "Unable to find native function: {0} (Error code: {1}). Make sure that module.def is up to date", + procName, error)); + } return TypeCaster<T>.Cast(Marshal.GetDelegateForFunctionPointer(procPtr, typeof (T))); } http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableObject.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableObject.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableObject.cs index 3da8dec..9855d84 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableObject.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/IPortableObject.cs @@ -17,6 +17,8 @@ namespace Apache.Ignite.Core.Portable { + using System.Diagnostics.CodeAnalysis; + /// <summary> /// Wrapper for serialized portable objects. /// </summary> @@ -34,6 +36,8 @@ namespace Apache.Ignite.Core.Portable /// Gets object metadata. /// </summary> /// <returns>Metadata.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] IPortableMetadata GetMetadata(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableConfiguration.cs index 39878c2..f83580c 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Portable/PortableConfiguration.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Portable { using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Portable type configuration. @@ -59,6 +60,7 @@ namespace Apache.Ignite.Core.Portable /// <summary> /// Type configurations. /// </summary> + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public ICollection<PortableTypeConfiguration> TypeConfigurations { get; @@ -68,6 +70,7 @@ namespace Apache.Ignite.Core.Portable /// <summary> /// Portable types. Shorthand for creating PortableTypeConfiguration. /// </summary> + [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")] public ICollection<string> Types { get; http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Services/IServices.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Services/IServices.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Services/IServices.cs index fff25c3..ec1a044 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Services/IServices.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Services/IServices.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Services { using System.Collections.Generic; + using System.Diagnostics.CodeAnalysis; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; @@ -124,6 +125,8 @@ namespace Apache.Ignite.Core.Services /// Gets metadata about all deployed services. /// </summary> /// <returns>Metadata about all deployed services.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] ICollection<IServiceDescriptor> GetServiceDescriptors(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs index 83f12a5..a3be198 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Transactions { using System; + using System.Diagnostics.CodeAnalysis; /// <summary> /// Transactions facade. @@ -63,6 +64,8 @@ namespace Apache.Ignite.Core.Transactions /// <summary> /// Gets the metrics. /// </summary> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", + Justification = "Expensive operation.")] ITransactionMetrics GetMetrics(); /// <summary> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.FxCop ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.FxCop b/modules/platforms/dotnet/Apache.Ignite.FxCop new file mode 100644 index 0000000..9345c19 --- /dev/null +++ b/modules/platforms/dotnet/Apache.Ignite.FxCop @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?> +<FxCopProject Version="1.36" Name="Apache Ignite"> + <ProjectOptions> + <SharedProject>True</SharedProject> + <Stylesheet Apply="False" /> + <SaveMessages> + <Project Status="Active, Excluded" NewOnly="False" /> + <Report Status="Active" NewOnly="False" /> + </SaveMessages> + <ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="True" /> + <EnableMultithreadedLoad>True</EnableMultithreadedLoad> + <EnableMultithreadedAnalysis>True</EnableMultithreadedAnalysis> + <SourceLookup>True</SourceLookup> + <AnalysisExceptionsThreshold>10</AnalysisExceptionsThreshold> + <RuleExceptionsThreshold>1</RuleExceptionsThreshold> + <Spelling Locale="en-US" /> + <OverrideRuleVisibilities>False</OverrideRuleVisibilities> + <CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" /> + <SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache> + <DeadlockDetectionTimeout>120</DeadlockDetectionTimeout> + <IgnoreGeneratedCode>False</IgnoreGeneratedCode> + </ProjectOptions> + <Targets> + <Target Name="$(ProjectDir)/Apache.Ignite.Core/bin/x64/Debug/Apache.Ignite.Core.dll" Analyze="True" AnalyzeAllChildren="True" /> + </Targets> + <Rules> + <RuleFiles> + <RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="False"> + <Rule Name="AbstractTypesShouldNotHaveConstructors" Enabled="True" /> + <Rule Name="AvoidEmptyInterfaces" Enabled="True" /> + <Rule Name="AvoidOutParameters" Enabled="True" /> + <Rule Name="CollectionsShouldImplementGenericInterface" Enabled="True" /> + <Rule Name="ConsiderPassingBaseTypesAsParameters" Enabled="True" /> + <Rule Name="DeclareEventHandlersCorrectly" Enabled="True" /> + <Rule Name="DeclareTypesInNamespaces" Enabled="True" /> + <Rule Name="DefineAccessorsForAttributeArguments" Enabled="True" /> + <Rule Name="DoNotCatchGeneralExceptionTypes" Enabled="True" /> + <Rule Name="DoNotDeclareProtectedMembersInSealedTypes" Enabled="True" /> + <Rule Name="DoNotDeclareStaticMembersOnGenericTypes" Enabled="True" /> + <Rule Name="DoNotDeclareVirtualMembersInSealedTypes" Enabled="True" /> + <Rule Name="DoNotDeclareVisibleInstanceFields" Enabled="True" /> + <Rule Name="DoNotExposeGenericLists" Enabled="True" /> + <Rule Name="DoNotHideBaseClassMethods" Enabled="True" /> + <Rule Name="DoNotOverloadOperatorEqualsOnReferenceTypes" Enabled="True" /> + <Rule Name="DoNotPassTypesByReference" Enabled="True" /> + <Rule Name="DoNotRaiseExceptionsInUnexpectedLocations" Enabled="True" /> + <Rule Name="EnumeratorsShouldBeStronglyTyped" Enabled="True" /> + <Rule Name="EnumsShouldHaveZeroValue" Enabled="True" /> + <Rule Name="EnumStorageShouldBeInt32" Enabled="True" /> + <Rule Name="ExceptionsShouldBePublic" Enabled="True" /> + <Rule Name="ICollectionImplementationsHaveStronglyTypedMembers" Enabled="True" /> + <Rule Name="ImplementIDisposableCorrectly" Enabled="True" /> + <Rule Name="ImplementStandardExceptionConstructors" Enabled="True" /> + <Rule Name="IndexersShouldNotBeMultidimensional" Enabled="True" /> + <Rule Name="InterfaceMethodsShouldBeCallableByChildTypes" Enabled="True" /> + <Rule Name="ListsAreStronglyTyped" Enabled="True" /> + <Rule Name="MarkAssembliesWithAssemblyVersion" Enabled="True" /> + <Rule Name="MarkAssembliesWithClsCompliant" Enabled="True" /> + <Rule Name="MarkAssembliesWithComVisible" Enabled="True" /> + <Rule Name="MarkAttributesWithAttributeUsage" Enabled="True" /> + <Rule Name="MarkEnumsWithFlags" Enabled="True" /> + <Rule Name="MembersShouldNotExposeCertainConcreteTypes" Enabled="True" /> + <Rule Name="MovePInvokesToNativeMethodsClass" Enabled="True" /> + <Rule Name="NestedTypesShouldNotBeVisible" Enabled="True" /> + <Rule Name="OverloadOperatorEqualsOnOverloadingAddAndSubtract" Enabled="True" /> + <Rule Name="OverrideMethodsOnComparableTypes" Enabled="True" /> + <Rule Name="PropertiesShouldNotBeWriteOnly" Enabled="True" /> + <Rule Name="ProvideObsoleteAttributeMessage" Enabled="True" /> + <Rule Name="ReplaceRepetitiveArgumentsWithParamsArray" Enabled="True" /> + <Rule Name="StaticHolderTypesShouldBeSealed" Enabled="True" /> + <Rule Name="StaticHolderTypesShouldNotHaveConstructors" Enabled="True" /> + <Rule Name="StringUriOverloadsCallSystemUriOverloads" Enabled="True" /> + <Rule Name="TypesShouldNotExtendCertainBaseTypes" Enabled="True" /> + <Rule Name="TypesThatOwnDisposableFieldsShouldBeDisposable" Enabled="True" /> + <Rule Name="TypesThatOwnNativeResourcesShouldBeDisposable" Enabled="True" /> + <Rule Name="UriParametersShouldNotBeStrings" Enabled="True" /> + <Rule Name="UriPropertiesShouldNotBeStrings" Enabled="True" /> + <Rule Name="UriReturnValuesShouldNotBeStrings" Enabled="True" /> + <Rule Name="UseEventsWhereAppropriate" Enabled="True" /> + <Rule Name="UseGenericEventHandlerInstances" Enabled="True" /> + <Rule Name="UseGenericsWhereAppropriate" Enabled="True" /> + <Rule Name="UseIntegralOrStringArgumentForIndexers" Enabled="True" /> + <Rule Name="UsePropertiesWhereAppropriate" Enabled="True" /> + </RuleFile> + <RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\InteroperabilityRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\MobilityRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="False"> + <Rule Name="CompoundWordsShouldBeCasedCorrectly" Enabled="True" /> + <Rule Name="DoNotNameEnumValuesReserved" Enabled="True" /> + <Rule Name="DoNotPrefixEnumValuesWithTypeName" Enabled="True" /> + <Rule Name="EventsShouldNotHaveBeforeOrAfterPrefix" Enabled="True" /> + <Rule Name="FlagsEnumsShouldHavePluralNames" Enabled="True" /> + <Rule Name="IdentifiersShouldDifferByMoreThanCase" Enabled="True" /> + <Rule Name="IdentifiersShouldHaveCorrectPrefix" Enabled="True" /> + <Rule Name="IdentifiersShouldHaveCorrectSuffix" Enabled="True" /> + <Rule Name="IdentifiersShouldNotContainUnderscores" Enabled="True" /> + <Rule Name="IdentifiersShouldNotHaveIncorrectPrefix" Enabled="True" /> + <Rule Name="IdentifiersShouldNotHaveIncorrectSuffix" Enabled="True" /> + <Rule Name="OnlyFlagsEnumsShouldHavePluralNames" Enabled="True" /> + <Rule Name="ParameterNamesShouldMatchBaseDeclaration" Enabled="True" /> + <Rule Name="ParameterNamesShouldNotMatchMemberNames" Enabled="True" /> + <Rule Name="PropertyNamesShouldNotMatchGetMethods" Enabled="True" /> + <Rule Name="ResourceStringCompoundWordsShouldBeCasedCorrectly" Enabled="True" /> + <Rule Name="ResourceStringsShouldBeSpelledCorrectly" Enabled="True" /> + <Rule Name="TypeNamesShouldNotMatchNamespaces" Enabled="True" /> + </RuleFile> + <RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\PortabilityRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" /> + <RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" /> + </RuleFiles> + <Groups /> + <Settings /> + </Rules> + <FxCopReport Version="1.36" /> +</FxCopProject> http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/modules/platforms/dotnet/Apache.Ignite.sln ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.sln b/modules/platforms/dotnet/Apache.Ignite.sln index 77e7f3a..64355aa 100644 --- a/modules/platforms/dotnet/Apache.Ignite.sln +++ b/modules/platforms/dotnet/Apache.Ignite.sln @@ -20,6 +20,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Ignite.ExamplesDll", {27F7F3C6-BDDE-43A9-B565-856F8395A04B} = {27F7F3C6-BDDE-43A9-B565-856F8395A04B} EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E0784F76-949C-456E-A529-A55D0E389165}" + ProjectSection(SolutionItems) = preProject + Apache.Ignite.FxCop = Apache.Ignite.FxCop + Apache.Ignite.sln.DotSettings = Apache.Ignite.sln.DotSettings + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 http://git-wip-us.apache.org/repos/asf/ignite/blob/b9256a1e/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index faf867e..66a65bc 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -738,6 +738,13 @@ <exclude>ipc/shmem/igniteshmem/.deps/*</exclude><!--tmp files--> <exclude>ipc/shmem/igniteshmem/libigniteshmem.la</exclude><!--tmp (not under VCS)--> <exclude>ipc/shmem/igniteshmem/libigniteshmem_la-org_apache_ignite_internal_util_ipc_shmem_IpcSharedMemoryUtils.lo</exclude><!--tmp (not under VCS)--> + <!--platform--> + <exclude>src/main/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj</exclude> + <exclude>src/main/dotnet/Apache.Ignite.sln</exclude> + <exclude>src/main/dotnet/Apache.Ignite.sln.DotSettings</exclude> + <exclude>src/main/java/META-INF/services/org.apache.ignite.internal.processors.platform.PlatformBootstrapFactory</exclude> + <exclude>src/main/resources/META-INF/services/org.apache.ignite.internal.processors.platform.PlatformBootstrapFactory</exclude> + <exclude>src/test/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj</exclude> <exclude>src/test/portables/repo/org/apache/ignite/portable/test1/1.1/test1-1.1.jar</exclude> <exclude>src/test/portables/repo/org/apache/ignite/portable/test2/1.1/test2-1.1.jar</exclude> <!--platforms--> @@ -746,8 +753,9 @@ <exclude>**/configure.ac</exclude> <exclude>**/*.pc.in</exclude> <exclude>**/*.sln</exclude> - <exclude>**/*.slnrel</exclude> + <exclude>**/*.slnrel</exclude> <exclude>**/*.sln.DotSettings</exclude> + <exclude>**/*.FxCop</exclude> <exclude>**/*.csproj</exclude> <exclude>**/*.csprojrel</exclude> <exclude>**/*.vcxproj</exclude>
