From 93b776f020c502fd01edef004c9960e6a08b013d Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 23 Mar 2021 22:48:09 -0400 Subject: [PATCH] Seal internal types in libraries --- docs/coding-guidelines/coding-style.md | 3 +- .../Generic/ArraySortHelper.CoreCLR.cs | 8 +- .../ManifestBasedResourceGroveler.CoreCLR.cs | 2 +- .../src/System/Threading/Timer.CoreCLR.cs | 2 +- .../Common/src/Extensions/EmptyDisposable.cs | 2 +- .../Logging/NullExternalScopeProvider.cs | 2 +- .../src/Extensions/Logging/NullScope.cs | 2 +- .../Interop.Ssl.cs | 2 +- .../Common/src/Interop/Interop.Ldap.cs | 2 +- .../Interop/Linux/OpenLdap/Interop.Ldap.cs | 2 +- .../OSX/Interop.CoreFoundation.CFProxy.cs | 2 +- .../Interop.SslErr.cs | 2 +- .../Advapi32/Interop.ENUM_SERVICE_STATUS.cs | 2 +- .../Interop.ENUM_SERVICE_STATUS_PROCESS.cs | 2 +- .../CryptUI/Interop.CryptUIDlgCertificate.cs | 4 +- .../SspiCli/SecurityPackageInfoClass.cs | 2 +- .../Interop/Windows/WinMm/Interop.MMCKINFO.cs | 2 +- .../Interop/Windows/WinMm/Interop.mmioRead.cs | 2 +- .../src/System/CodeDom/CodeTypeReference.cs | 2 +- .../CodeDom/CodeTypeReferenceCollection.cs | 2 +- .../System/Data/Common/DbConnectionPoolKey.cs | 8 +- .../System/Data/ProviderBase/TimeoutTimer.cs | 2 +- .../src/System/Net/CaseInsensitiveAscii.cs | 2 +- .../src/System/Net/ContextAwareResult.cs | 2 +- .../src/System/Net/Http/WinInetProxyHelper.cs | 2 +- .../aspnetcore/Http2/Hpack/DynamicTable.cs | 2 +- .../aspnetcore/Http2/Hpack/HPackDecoder.cs | 2 +- .../Http2/Hpack/HPackDecodingException.cs | 2 +- .../Http2/Hpack/HuffmanDecodingException.cs | 4 +- .../aspnetcore/Http2/Hpack/IntegerDecoder.cs | 2 +- .../aspnetcore/Http3/QPack/QPackDecoder.cs | 2 +- .../aspnetcore/Http3/QPack/QPackEncoder.cs | 2 +- .../Common/src/System/Net/Mail/MailAddress.cs | 2 +- .../src/System/Net/NTAuthentication.Common.cs | 2 +- .../Common/src/System/Net/TlsStream.cs | 2 +- .../Runtime/InteropServices/ComEventsSink.cs | 2 +- src/libraries/Common/src/System/SR.cs | 2 +- .../TaskCompletionSourceWithCancellation.cs | 2 +- .../CSharp/RuntimeBinder/BinderEquivalence.cs | 2 +- .../RuntimeBinder/ComInterop/ComBinder.cs | 2 +- .../ComInterop/ComClassMetaObject.cs | 2 +- .../RuntimeBinder/ComInterop/ComEventDesc.cs | 2 +- .../ComInterop/ComEventSinksContainer.cs | 2 +- .../ComInterop/ComEventsSink.Extended.cs | 2 +- .../RuntimeBinder/ComInterop/ComMetaObject.cs | 2 +- .../RuntimeBinder/ComInterop/ComMethodDesc.cs | 2 +- .../ComInterop/ComTypeClassDesc.cs | 2 +- .../ComInterop/ConversionArgBuilder.cs | 2 +- .../ComInterop/ConvertArgBuilder.cs | 2 +- .../ComInterop/ConvertibleArgBuilder.cs | 2 +- .../ComInterop/DispCallableMetaObject.cs | 2 +- .../ComInterop/DispatchArgBuilder.cs | 2 +- .../ComInterop/ErrorArgBuilder.cs | 2 +- .../ComInterop/StringArgBuilder.cs | 2 +- .../ComInterop/TypeEnumMetaObject.cs | 2 +- .../ComInterop/TypeLibMetaObject.cs | 2 +- .../ComInterop/UnknownArgBuilder.cs | 2 +- .../ComInterop/VarEnumSelector.cs | 2 +- .../ComInterop/VariantArgBuilder.cs | 2 +- .../ComInterop/VariantBuilder.cs | 2 +- .../RuntimeBinder/DynamicDebuggerProxy.cs | 6 +- .../Semantics/MemberLookupResults.cs | 2 +- .../RuntimeBinder/Semantics/MethodIterator.cs | 2 +- .../Semantics/Symbols/AggregateSymbol.cs | 2 +- .../Semantics/Symbols/FieldSymbol.cs | 2 +- .../src/CacheEntry.CacheEntryState.cs | 2 +- .../src/CacheEntry.CacheEntryTokens.cs | 2 +- .../src/CacheEntry.cs | 2 +- .../src/XmlConfigurationElement.cs | 2 +- .../XmlConfigurationElementAttributeValue.cs | 2 +- .../src/XmlConfigurationElementTextContent.cs | 2 +- .../src/XmlStreamConfigurationProvider.cs | 2 +- .../src/CallSiteJsonFormatter.cs | 2 +- .../src/ServiceLookup/CallSiteChain.cs | 2 +- .../src/ServiceLookup/CallSiteFactory.cs | 2 +- .../src/ServiceLookup/CallSiteValidator.cs | 2 +- .../src/ServiceLookup/ConstantCallSite.cs | 2 +- .../src/ServiceLookup/ConstructorCallSite.cs | 2 +- .../DynamicServiceProviderEngine.cs | 2 +- .../Expressions/ExpressionResolverBuilder.cs | 2 +- .../ExpressionsServiceProviderEngine.cs | 2 +- .../src/ServiceLookup/FactoryCallSite.cs | 2 +- .../src/ServiceLookup/IEnumerableCallSite.cs | 2 +- .../ILEmit/ILEmitResolverBuilderContext.cs | 2 +- .../ILEmit/ILEmitServiceProviderEngine.cs | 2 +- .../RuntimeServiceProviderEngine.cs | 2 +- .../ServiceLookup/ServiceProviderCallSite.cs | 2 +- .../ServiceProviderEngineScope.cs | 2 +- .../ServiceScopeFactoryCallSite.cs | 2 +- .../src/DependencyContextPaths.cs | 2 +- .../src/DirectoryWrapper.cs | 2 +- .../src/EnvironmentWrapper.cs | 2 +- .../src/FileSystemWrapper.cs | 2 +- .../src/FileWrapper.cs | 2 +- .../src/Internal/Clock.cs | 2 +- .../src/Internal/InMemoryFileInfo.cs | 2 +- .../src/HostFactoryResolver.cs | 2 +- .../src/Internal/ConfigureContainerAdapter.cs | 2 +- .../src/Internal/Host.cs | 2 +- .../src/Internal/ServiceFactoryAdapter.cs | 2 +- .../src/ValidationHostedService.cs | 2 +- .../src/ValidatorOptions.cs | 2 +- .../src/ActiveHandlerTrackingEntry.cs | 2 +- .../src/DefaultHttpMessageHandlerBuilder.cs | 2 +- .../src/DefaultTypedHttpClientFactory.cs | 2 +- .../DefaultHttpClientBuilder.cs | 2 +- .../HttpClientMappingRegistry.cs | 2 +- .../src/ExpiredHandlerTrackingEntry.cs | 2 +- .../src/LifetimeTrackingHttpMessageHandler.cs | 2 +- .../src/Logging/HttpHeadersLogValue.cs | 2 +- .../LoggingHttpMessageHandlerBuilderFilter.cs | 2 +- .../src/LogValuesFormatter.cs | 2 +- .../src/LoggerFilterConfigureOptions.cs | 2 +- .../src/LoggerProviderConfiguration.cs | 2 +- .../src/LoggerProviderConfigurationFactory.cs | 2 +- .../src/LoggerProviderConfigureOptions.cs | 2 +- .../src/LoggingConfiguration.cs | 2 +- .../src/AnsiLogConsole.cs | 2 +- .../src/AnsiParser.cs | 2 +- .../src/AnsiParsingLogConsole.cs | 2 +- .../src/ConsoleLogger.cs | 2 +- .../src/ConsoleLoggerExtensions.cs | 4 +- .../src/FormatterOptionsMonitor.cs | 2 +- .../src/JsonConsoleFormatter.cs | 2 +- .../src/SimpleConsoleFormatter.cs | 2 +- .../src/SystemdConsoleFormatter.cs | 2 +- .../src/DebugLogger.cs | 2 +- .../src/DebugLogger.debug.cs | 2 +- .../src/EventLogLogger.cs | 2 +- .../src/WindowsEventLog.cs | 2 +- .../src/EventLogFiltersConfigureOptions.cs | 2 +- ...tLogFiltersConfigureOptionsChangeSource.cs | 2 +- .../src/EventSourceLogger.cs | 2 +- .../src/ExceptionInfo.cs | 2 +- .../src/TraceSourceLogger.cs | 2 +- .../src/TraceSourceScope.cs | 2 +- .../src/DefaultLoggerLevelConfigureOptions.cs | 2 +- .../src/Logger.cs | 2 +- .../src/LoggerFactoryScopeProvider.cs | 2 +- .../src/LoggingBuilder.cs | 2 +- .../src/StaticFilterOptionsMonitor.cs | 2 +- .../src/OptionsMonitor.cs | 2 +- .../src/Sgen.cs | 2 +- .../ImmutableDictionary_2.Builder.cs | 2 +- .../ImmutableEnumerableDebuggerProxy.cs | 2 +- .../Immutable/ImmutableList_1.Builder.cs | 2 +- .../ImmutableSortedDictionary_2.Builder.cs | 2 +- ...utableSortedSet_1.Builder.DebuggerProxy.cs | 2 +- .../Collections/Immutable/SecureObjectPool.cs | 4 +- .../src/System/Collections/Queue.cs | 2 +- .../src/System/Collections/SortedList.cs | 2 +- .../src/System/Collections/Stack.cs | 2 +- .../Specialized/NameObjectCollectionBase.cs | 4 +- .../AssociatedMetadataTypeTypeDescriptor.cs | 2 +- .../DataAnnotations/LocalizableString.cs | 2 +- .../MetadataPropertyDescriptorWrapper.cs | 2 +- .../DataAnnotations/UIHintAttribute.cs | 2 +- .../ValidationAttributeStore.cs | 2 +- .../Registration/RegistrationBuilder.cs | 2 +- .../Collections/WeakReferenceCollection.cs | 2 +- .../AttributedExportDefinition.cs | 2 +- .../AttributedPartCreationInfo.cs | 2 +- .../CompositionErrorDebuggerProxy.cs | 2 +- .../CompositionExceptionDebuggerProxy.cs | 2 +- .../ExportServices.DisposableLazy.cs | 2 +- .../Hosting/AssemblyCatalogDebuggerProxy.cs | 2 +- ...CatalogExportProvider.PartCreatorExport.cs | 2 +- ...atalogExportProvider.ScopeFactoryExport.cs | 2 +- .../CatalogExportProvider.ScopeManager.cs | 2 +- .../ComposablePartCatalogCollection.cs | 4 +- ...CompositionScopeDefinitionDebuggerProxy.cs | 4 +- ...ryCatalog.DirectoryCatalogDebuggerProxy.cs | 2 +- .../FilteredCatalog.DependenciesTraversal.cs | 2 +- .../FilteredCatalog.DependentsTraversal.cs | 2 +- .../ImportSourceImportDefinitionHelpers.cs | 2 +- ...rdinalityMismatchExceptionDebuggerProxy.cs | 2 +- .../ComposablePartCatalogDebuggerProxy.cs | 2 +- .../ComposablePartExceptionDebuggerProxy.cs | 2 +- .../Primitives/CompositionElement.cs | 2 +- .../CompositionElementDebuggerProxy.cs | 2 +- .../SerializableCompositionElement.cs | 2 +- .../ReflectionModel/ExportingMember.cs | 2 +- .../GenericSpecializationPartCreationInfo.cs | 2 +- .../Composition/ReflectionModel/ImportType.cs | 2 +- .../ReflectionModel/ImportingMember.cs | 2 +- .../ReflectionModel/ImportingParameter.cs | 2 +- .../PartCreatorExportDefinition.cs | 2 +- .../PartCreatorMemberImportDefinition.cs | 2 +- .../PartCreatorParameterImportDefinition.cs | 2 +- .../ReflectionComposablePartDefinition.cs | 2 +- .../ReflectionModel/ReflectionField.cs | 2 +- .../ReflectionMemberExportDefinition.cs | 2 +- .../ReflectionModel/ReflectionMethod.cs | 2 +- .../ReflectionModelServices.cs | 4 +- .../ReflectionModel/ReflectionParameter.cs | 2 +- .../ReflectionModel/ReflectionProperty.cs | 2 +- .../ReflectionModel/ReflectionType.cs | 2 +- .../ref/System.ComponentModel.manual.cs | 2 +- .../Linq/ComponentModel/XComponentModel.cs | 22 ++--- .../Design/DesigntimeLicenseContext.cs | 2 +- .../src/System/InvariantComparer.cs | 2 +- .../Core/CycleBreakingExportDescriptor.cs | 2 +- .../Core/CycleBreakingMetadataDictionary.cs | 2 +- .../Hosting/Core/DirectExportDescriptor.cs | 2 +- .../Hosting/Core/ExportDescriptorRegistry.cs | 2 +- .../Core/ExportDescriptorRegistryUpdate.cs | 2 +- .../Composition/Hosting/Core/UpdateResult.cs | 2 +- .../CurrentScopeExportDescriptorProvider.cs | 2 +- .../ExportFactoryExportDescriptorProvider.cs | 2 +- ...oryWithMetadataExportDescriptorProvider.cs | 2 +- .../ImportManyExportDescriptorProvider.cs | 2 +- .../Lazy/LazyExportDescriptorProvider.cs | 2 +- ...azyWithMetadataExportDescriptorProvider.cs | 2 +- .../Hosting/Util/SmallSparseInitonlyArray.cs | 2 +- .../ContainerConfigurationDebuggerProxy.cs | 2 +- .../Debugging/DiscoveredPartDebuggerProxy.cs | 2 +- .../ActivationFeatures/DisposalFeature.cs | 2 +- .../ActivationFeatures/LifetimeFeature.cs | 2 +- .../OnImportsSatisfiedFeature.cs | 2 +- .../ActivationFeatures/PropertyImportSite.cs | 2 +- .../PropertyInjectionFeature.cs | 2 +- .../Discovery/DiscoveredInstanceExport.cs | 2 +- .../TypedParts/Discovery/DiscoveredPart.cs | 2 +- .../Discovery/DiscoveredPropertyExport.cs | 2 +- .../Discovery/ParameterImportSite.cs | 2 +- .../TypedParts/Discovery/TypeInspector.cs | 2 +- .../Composition/TypedParts/ImportInfo.cs | 2 +- .../TypedPartExportDescriptorProvider.cs | 2 +- .../TypedParts/Util/DirectAttributeContext.cs | 2 +- .../System/Configuration/ClientConfigPaths.cs | 2 +- .../Configuration/ConfigDefinitionUpdates.cs | 2 +- .../ConfigurationSchemaErrors.cs | 2 +- .../Configuration/ConfigurationValue.cs | 2 +- .../Configuration/ConfigurationValues.cs | 2 +- .../DateTimeConfigurationElement.cs | 2 +- .../System/Configuration/DeclarationUpdate.cs | 2 +- .../System/Configuration/DefinitionUpdate.cs | 2 +- .../EmptyImpersonationContext.cs | 2 +- .../src/System/Configuration/FactoryId.cs | 2 +- .../src/System/Configuration/FactoryRecord.cs | 2 +- .../ImplicitMachineConfigHost.cs | 2 +- .../Configuration/Internal/ConfigSystem.cs | 2 +- .../Configuration/Internal/DummyDisposable.cs | 2 +- .../Configuration/Internal/FileVersion.cs | 2 +- .../Internal/WriteFileContext.cs | 2 +- .../KeyValueInternalCollection.cs | 2 +- .../Configuration/LocationSectionRecord.cs | 2 +- .../System/Configuration/LocationUpdates.cs | 2 +- .../Configuration/PropertySourceInfo.cs | 2 +- .../ReadOnlyNameValueCollection.cs | 2 +- .../src/System/Configuration/SectionInput.cs | 2 +- .../src/System/Configuration/SectionRecord.cs | 2 +- .../System/Configuration/SectionUpdates.cs | 2 +- .../src/System/Configuration/StreamInfo.cs | 2 +- .../src/System/Configuration/StreamUpdate.cs | 2 +- .../System/Configuration/UpdateConfigHost.cs | 2 +- .../src/System/Configuration/XmlUtilWriter.cs | 2 +- .../src/System/ConsolePal.Unix.cs | 2 +- .../ref/System.Data.Common.manual.cs | 16 ++-- .../Data/Common/DataCommonEventSource.cs | 2 +- .../DbConnectionStringBuilderDescriptor.cs | 2 +- .../src/System/Data/SQLTypes/SQLString.cs | 2 +- .../src/System/Data/SortExpressionBuilder.cs | 2 +- .../DbConnectionPoolProviderInfo.cs | 2 +- .../System/Data/Odbc/OdbcMetaDataFactory.cs | 2 +- .../ref/System.Data.OleDb.Manual.cs | 10 +-- .../Data/Common/DataCommonEventSource.cs | 2 +- .../System/Data/Common/DbConnectionPoolKey.cs | 6 +- .../src/System/Diagnostics/Activity.cs | 2 +- .../src/System/Diagnostics/ActivitySource.cs | 2 +- .../System/Diagnostics/DiagnosticListener.cs | 2 +- .../DiagnosticSourceEventSource.cs | 14 +-- .../Diagnostics/RandomNumberGenerator.cs | 2 +- .../System/Diagnostics/EventLogInternal.cs | 2 +- .../ProviderMetadataCachedInformation.cs | 2 +- .../System/Diagnostics/PerfCounterSection.cs | 2 +- .../Diagnostics/PerformanceCounterLib.cs | 8 +- .../Diagnostics/SharedPerformanceCounter.cs | 2 +- .../Diagnostics/SystemDiagnosticsSection.cs | 2 +- .../Diagnostics/PerformanceCounterLib.cs | 2 +- .../System/Diagnostics/StackTraceSymbols.cs | 2 +- .../AccountManagement/AD/ADAMStoreCtx.cs | 2 +- .../AD/ADDNConstraintLinkedAttrSet.cs | 2 +- .../AccountManagement/AD/ADDNLinkedAttrSet.cs | 2 +- .../AccountManagement/AD/ADEntriesSet.cs | 2 +- .../AccountManagement/AD/ADStoreKey.cs | 2 +- .../AD/DSPropertyCollection.cs | 4 +- .../AccountManagement/AD/QBEMatchType.cs | 2 +- .../AccountManagement/AD/RangeRetriever.cs | 2 +- .../AccountManagement/AD/SDSCache.cs | 2 +- .../AccountManagement/AD/SidList.cs | 8 +- .../AccountManagement/AD/TokenGroupsSet.cs | 2 +- .../AccountManagement/AccountInfo.cs | 2 +- .../AccountManagement/AuthZSet.cs | 2 +- .../AccountManagement/ConfigurationHandler.cs | 2 +- .../AccountManagement/EmptySet.cs | 4 +- .../AccountManagement/ExtensionCache.cs | 4 +- .../AccountManagement/ExtensionHelper.cs | 2 +- .../AccountManagement/FindResultEnumerator.cs | 2 +- .../AccountManagement/IdentityClaim.cs | 2 +- .../AccountManagement/IdentityReference.cs | 2 +- .../AccountManagement/NetCred.cs | 2 +- .../AccountManagement/Pair.cs | 2 +- .../AccountManagement/PasswordInfo.cs | 2 +- .../PrincipalCollectionEnumerator.cs | 2 +- .../AccountManagement/QbeFilterDescription.cs | 82 ++++++++--------- .../AccountManagement/SAM/SAMGroupsSet.cs | 2 +- .../AccountManagement/SAM/SAMMembersSet.cs | 4 +- .../AccountManagement/SAM/SAMQuerySet.cs | 8 +- .../AccountManagement/SAM/SAMStoreCtx.cs | 2 +- .../SAM/SAMStoreCtx_LoadStore.cs | 2 +- .../SAM/SAMStoreCtx_Query.cs | 2 +- .../AccountManagement/SAM/SAMStoreKey.cs | 2 +- .../AccountManagement/TrackedCollection.cs | 4 +- .../TrackedCollectionEnumerator.cs | 2 +- .../AccountManagement/UnknownPrincipal.cs | 2 +- .../ValueCollectionEnumerator.cs | 2 +- .../Protocols/ldap/LdapAsyncResult.cs | 4 +- .../ldap/LdapPartialResultsProcessor.cs | 4 +- .../ref/System.DirectoryServices.manual.cs | 2 +- .../src/Interop/AdsValueHelper2.cs | 6 +- .../ActiveDirectory/ADSearcher.cs | 2 +- .../ActiveDirectory/ActiveDirectorySyntax.cs | 4 +- .../ActiveDirectory/DirectoryEntryManager.cs | 4 +- .../src/System/DirectoryServices/AdsVLV.cs | 2 +- .../Design/DirectoryEntryConverter.cs | 2 +- .../DirectoryServices/SchemaNameCollection.cs | 2 +- .../src/Interop/Windows/Interop.Comdlg32.cs | 4 +- .../src/Interop/Windows/Interop.Gdi32.cs | 2 +- .../src/System/Drawing/ClientUtils.cs | 4 +- .../src/System/Drawing/GdiplusNative.Unix.cs | 2 +- .../src/System/Drawing/GraphicsContext.cs | 2 +- .../src/System/Drawing/Icon.Unix.cs | 4 +- .../src/System/Drawing/Icon.Windows.cs | 2 +- .../src/System/Drawing/ImageAnimator.Unix.cs | 4 +- .../Drawing/Imaging/ImageCodecInfoPrivate.cs | 2 +- .../Drawing/Imaging/MetafileHeaderEmf.cs | 2 +- .../Drawing/Imaging/MetafileHeaderWmf.cs | 2 +- .../Drawing/Printing/PrintPreviewGraphics.cs | 2 +- .../Drawing/Printing/PrintingServices.Unix.cs | 4 +- .../src/misc/GDI/DeviceContext.cs | 2 +- .../System/Formats/Asn1/SetOfValueComparer.cs | 2 +- .../src/System/IO/ReadLinesIterator.cs | 2 +- .../MemoryMappedView.Unix.cs | 2 +- .../MemoryMappedView.Windows.cs | 2 +- .../IO/MemoryMappedFiles/MemoryMappedView.cs | 4 +- .../InternalRelationshipCollection.cs | 2 +- .../System/IO/Packaging/OrderedDictionary.cs | 2 +- .../Packaging/PartBasedPackageProperties.cs | 2 +- .../System/IO/Packaging/ZipStreamManager.cs | 4 +- .../System/IO/Packaging/ZipWrappingStream.cs | 2 +- .../System/IO/Pipelines/StreamPipeReader.cs | 2 +- .../System/IO/Pipelines/StreamPipeWriter.cs | 2 +- .../IO/Pipes/NamedPipeServerStream.Windows.cs | 2 +- .../src/System/Dynamic/ExpandoClass.cs | 2 +- .../Linq/Expressions/BinaryExpression.cs | 2 +- .../Linq/Expressions/BlockExpression.cs | 2 +- .../Compiler/DelegateHelpers.Generated.cs | 2 +- .../Compiler/LambdaCompiler.Address.cs | 2 +- .../Compiler/LambdaCompiler.Binary.cs | 2 +- .../Compiler/LambdaCompiler.ControlFlow.cs | 2 +- .../Compiler/LambdaCompiler.Expressions.cs | 2 +- .../Compiler/LambdaCompiler.Lambda.cs | 2 +- .../Compiler/LambdaCompiler.Logical.cs | 2 +- .../Compiler/LambdaCompiler.Statements.cs | 2 +- .../Compiler/LambdaCompiler.Unary.cs | 2 +- .../Compiler/StackSpiller.Bindings.cs | 2 +- .../Compiler/StackSpiller.ChildRewriter.cs | 2 +- .../Compiler/StackSpiller.Generated.cs | 2 +- .../StackSpiller.SpilledExpressionBlock.cs | 2 +- .../Compiler/StackSpiller.Temps.cs | 2 +- .../Linq/Expressions/ConstantExpression.cs | 2 +- .../Linq/Expressions/DynamicExpression.cs | 2 +- .../Expressions/Expression.DebuggerProxy.cs | 52 +++++------ .../Interpreter/CallInstruction.cs | 2 +- .../Interpreter/ControlFlowInstructions.cs | 2 +- .../Expressions/Interpreter/NewInstruction.cs | 2 +- .../Linq/Expressions/Interpreter/Utilities.cs | 2 +- .../Parallel/Enumerables/EmptyEnumerable.cs | 2 +- .../EnumerableWrapperWeakToStrong.cs | 4 +- .../Enumerables/ParallelEnumerableWrapper.cs | 4 +- .../Parallel/Enumerables/RangeEnumerable.cs | 2 +- .../Parallel/Enumerables/RepeatEnumerable.cs | 2 +- .../Linq/Parallel/Merging/ArrayMergeHelper.cs | 2 +- .../Parallel/Merging/DefaultMergeHelper.cs | 2 +- .../Linq/Parallel/Merging/MergeExecutor.cs | 2 +- .../Merging/OrderPreservingMergeHelper.cs | 2 +- .../OrderPreservingPipeliningMergeHelper.cs | 10 ++- .../Partitioning/HashRepartitionEnumerator.cs | 2 +- .../OrderedHashRepartitionEnumerator.cs | 2 +- .../OrderedHashRepartitionStream.cs | 2 +- .../Partitioning/PartitionedDataSource.cs | 2 +- .../UnorderedHashRepartitionStream.cs | 2 +- .../Binary/GroupJoinQueryOperator.cs | 2 +- .../Binary/HashJoinQueryOperatorEnumerator.cs | 6 +- .../Binary/JoinQueryOperator.cs | 2 +- .../QueryOperators/Binary/ZipQueryOperator.cs | 2 +- .../QueryOperators/ListQueryResults.cs | 2 +- .../Options/QueryExecutionOption.cs | 2 +- .../QueryOperators/PartitionedStreamMerger.cs | 2 +- .../PartitionerQueryOperator.cs | 2 +- .../QueryOperators/QueryOpeningEnumerator.cs | 2 +- .../Unary/GroupByQueryOperator.cs | 4 +- .../QueryOperators/Unary/SortQueryOperator.cs | 6 +- .../Parallel/Scheduling/CancellationState.cs | 2 +- .../OrderPreservingPipeliningSpoolingTask.cs | 2 +- .../Scheduling/OrderPreservingSpoolingTask.cs | 2 +- .../Scheduling/QueryTaskGroupState.cs | 2 +- .../Linq/Parallel/Scheduling/SpoolingTask.cs | 6 +- .../Linq/Parallel/Utils/FixedMaxHeap.cs | 2 +- .../Linq/Parallel/Utils/GrowingArray.cs | 2 +- .../System/Linq/Parallel/Utils/HashLookup.cs | 2 +- .../Linq/Parallel/Utils/IntValueEvent.cs | 2 +- .../System/Linq/Parallel/Utils/ListChunk.cs | 2 +- .../src/System/Linq/Parallel/Utils/Lookup.cs | 2 +- .../Linq/Parallel/Utils/ReverseComparer.cs | 2 +- .../src/System/Linq/Parallel/Utils/Shared.cs | 2 +- .../src/System/Linq/Parallel/Utils/Sorting.cs | 2 +- .../src/System/Linq/EnumerableRewriter.cs | 2 +- .../src/System/Linq/AppendPrepend.SpeedOpt.cs | 4 +- .../src/System/Linq/AppendPrepend.cs | 4 +- .../ref/System.Management.manual.cs | 6 +- .../Management/InteropClasses/WMIInterop.cs | 4 +- .../System/Management/ManagementEventArgs.cs | 4 +- .../Management/ManagementEventWatcher.cs | 2 +- .../Management/ManagementOperationWatcher.cs | 4 +- .../src/System/Management/ManagementPath.cs | 2 +- .../src/System/Management/ManagementQuery.cs | 2 +- .../src/System/Management/ManagementScope.cs | 10 +-- .../src/System/Management/WMIGenerator.cs | 2 +- .../src/System/Management/WmiEventSink.cs | 2 +- .../src/System/Net/Http/WinHttpAuthHelper.cs | 2 +- .../System/Net/Http/WinHttpChannelBinding.cs | 2 +- .../src/System/Net/Http/WinHttpException.cs | 2 +- .../Net/Http/WinHttpTransportContext.cs | 2 +- .../Net/Http/Headers/AltSvcHeaderParser.cs | 2 +- .../Net/Http/Headers/ByteArrayHeaderParser.cs | 2 +- .../Http/Headers/CacheControlHeaderParser.cs | 2 +- .../Net/Http/Headers/DateHeaderParser.cs | 2 +- .../System/Net/Http/Headers/HttpHeaders.cs | 2 +- .../Http/Headers/Int32NumberHeaderParser.cs | 2 +- .../Http/Headers/Int64NumberHeaderParser.cs | 2 +- .../Net/Http/Headers/MediaTypeHeaderParser.cs | 2 +- .../Http/Headers/ProductInfoHeaderParser.cs | 2 +- .../Net/Http/Headers/TimeSpanHeaderParser.cs | 2 +- .../Headers/TransferCodingHeaderParser.cs | 2 +- .../Net/Http/Headers/UriHeaderParser.cs | 2 +- .../AuthenticationHelper.Digest.cs | 4 +- .../AuthenticationHelper.NtAuth.cs | 2 +- .../ChunkedEncodingReadStream.cs | 2 +- .../ChunkedEncodingWriteStream.cs | 2 +- .../ConnectionCloseReadStream.cs | 2 +- .../ContentLengthReadStream.cs | 2 +- .../ContentLengthWriteStream.cs | 2 +- .../Http/SocketsHttpHandler/HttpConnection.cs | 4 +- .../HttpContentReadStream.cs | 2 +- .../HttpContentWriteStream.cs | 2 +- .../SocketsHttpHandler/RawConnectionStream.cs | 2 +- .../Net/Managed/HttpResponseStream.Managed.cs | 2 +- .../Net/Managed/HttpStreamAsyncResult.cs | 2 +- .../Managed/ListenerAsyncResult.Managed.cs | 2 +- .../src/System/Net/ServiceNameStore.cs | 2 +- .../Net/Windows/HttpListenerRequestContext.cs | 2 +- .../Net/Windows/WebSockets/WebSocketBuffer.cs | 2 +- .../WebSocketHttpListenerDuplexStream.cs | 4 +- .../src/System/Net/BufferedReadStream.cs | 2 +- .../src/System/Net/CloseableStream.cs | 2 +- .../src/System/Net/Mail/MailPriority.cs | 12 +-- .../src/System/Net/Mail/MailWriter.cs | 2 +- .../System/Net/Mail/SmtpConnection.Auth.cs | 2 +- .../src/System/Net/Mail/SmtpConnection.cs | 2 +- .../src/System/Net/Mail/SmtpReplyReader.cs | 2 +- .../System/Net/Mail/SmtpReplyReaderFactory.cs | 2 +- .../src/System/Net/Mail/SmtpTransport.cs | 4 +- .../src/System/Net/Mime/Base64Encoder.cs | 2 +- .../System/Net/Mime/Base64WriteStateInfo.cs | 2 +- .../src/System/Net/Mime/EightBitStream.cs | 2 +- .../System/Net/Mime/EncodedStreamFactory.cs | 10 +-- .../src/System/Net/Mime/HeaderCollection.cs | 2 +- .../src/System/Net/Mime/MimeBasePart.cs | 2 +- .../src/System/Net/Mime/MimeMultiPart.cs | 4 +- .../src/System/Net/Mime/MimePart.cs | 4 +- .../src/System/Net/Mime/MimeWriter.cs | 2 +- .../src/System/Net/Mime/QEncodedStream.cs | 2 +- .../src/System/Net/Mime/QEncoder.cs | 2 +- .../System/Net/Mime/QuotedPrintableStream.cs | 2 +- .../src/System/Net/Mime/SmtpDateTime.cs | 2 +- .../BsdIPGlobalProperties.cs | 2 +- .../BsdIPv4GlobalStatistics.cs | 2 +- .../BsdIPv4InterfaceProperties.cs | 2 +- .../BsdIPv4InterfaceStatistics.cs | 2 +- .../BsdIPv6InterfaceProperties.cs | 2 +- .../NetworkInformation/BsdIcmpV4Statistics.cs | 2 +- .../NetworkInformation/BsdIcmpV6Statistics.cs | 2 +- .../BsdIpInterfaceProperties.cs | 2 +- .../BsdIpInterfaceStatistics.cs | 2 +- .../NetworkInformation/BsdNetworkInterface.cs | 4 +- .../NetworkInformation/BsdTcpStatistics.cs | 2 +- .../NetworkInformation/BsdUdpStatistics.cs | 2 +- .../InternalIPAddressCollection.cs | 4 +- .../LinuxIPAddressInformation.cs | 2 +- .../LinuxIPGlobalProperties.cs | 2 +- .../LinuxIPGlobalStatistics.cs | 2 +- .../LinuxIPInterfaceProperties.cs | 2 +- .../LinuxIPInterfaceStatistics.cs | 2 +- .../LinuxIPv4InterfaceProperties.cs | 2 +- .../LinuxIPv4InterfaceStatistics.cs | 2 +- .../LinuxIPv6InterfaceProperties.cs | 2 +- .../LinuxIcmpV4Statistics.cs | 2 +- .../LinuxIcmpV6Statistics.cs | 2 +- .../LinuxNetworkInterface.cs | 4 +- .../NetworkInformation/LinuxTcpStatistics.cs | 2 +- .../NetworkInformation/LinuxUdpStatistics.cs | 2 +- .../SimpleGatewayIPAddressInformation.Unix.cs | 2 +- .../SimpleTcpConnectionInformation.Unix.cs | 2 +- .../SystemGatewayIPAddressInformation.cs | 2 +- .../SystemIPAddressInformation.cs | 2 +- .../SystemIPGlobalStatistics.cs | 2 +- .../SystemIPInterfaceProperties.cs | 2 +- .../SystemIPInterfaceStatistics.cs | 2 +- .../SystemIPv4InterfaceProperties.cs | 2 +- .../SystemIPv4InterfaceStatistics.cs | 2 +- .../SystemIPv6InterfaceProperties.cs | 2 +- .../SystemIcmpV4Statistics.cs | 2 +- .../SystemIcmpV6Statistics.cs | 2 +- .../SystemMulticastIPAddressInformation.cs | 2 +- .../SystemNetworkInterface.cs | 2 +- .../NetworkInformation/SystemTcpConnection.cs | 2 +- .../NetworkInformation/SystemTcpStatistics.cs | 2 +- .../NetworkInformation/SystemUdpStatistics.cs | 2 +- .../SystemUnicastIPAddressInformation.cs | 2 +- .../Net/NetworkInformation/TeredoHelper.cs | 2 +- .../UnixMulticastIPAddressInformation.cs | 2 +- .../UnixUnicastIPAddressInformation.cs | 2 +- .../MsQuic/Internal/MsQuicApi.cs | 2 +- .../MsQuic/Internal/MsQuicSecurityConfig.cs | 2 +- .../Internal/ResettableCompletionSource.cs | 4 +- .../src/System/Net/CommandStream.cs | 6 +- .../src/System/Net/FtpControlStream.cs | 4 +- .../src/System/Net/FtpDataStream.cs | 2 +- .../src/System/Net/FtpWebRequest.cs | 4 +- .../src/System/Net/WebRequest.cs | 4 +- .../src/System/Net/NTAuthentication.cs | 2 +- .../Security/CipherSuitesPolicyPal.Android.cs | 2 +- .../Security/CipherSuitesPolicyPal.Linux.cs | 2 +- .../Net/Security/CipherSuitesPolicyPal.OSX.cs | 2 +- .../Security/CipherSuitesPolicyPal.Windows.cs | 2 +- .../src/System/Net/Security/SecureChannel.cs | 4 +- .../Net/Security/SslAuthenticationOptions.cs | 2 +- .../Net/Security/SslConnectionInfo.Android.cs | 2 +- .../Net/Security/SslConnectionInfo.Linux.cs | 2 +- .../Net/Security/SslConnectionInfo.OSX.cs | 2 +- .../Net/Security/SslConnectionInfo.Unix.cs | 2 +- .../Net/Security/SslConnectionInfo.Windows.cs | 2 +- .../System/Net/Security/SslConnectionInfo.cs | 2 +- .../src/System/Net/HeaderInfo.cs | 2 +- .../src/System/Net/HeaderInfoTable.cs | 2 +- .../Collections/Generic/ArraySortHelper.cs | 8 +- .../System/Globalization/CalendarData.Icu.cs | 2 +- .../System/Globalization/CalendarData.Nls.cs | 2 +- .../System/Globalization/CalendarData.Unix.cs | 2 +- .../Globalization/CalendarData.Windows.cs | 2 +- .../src/System/Globalization/CalendarData.cs | 2 +- .../System/Globalization/CultureData.Icu.cs | 2 +- .../System/Globalization/CultureData.Nls.cs | 2 +- .../System/Globalization/CultureData.Unix.cs | 2 +- .../Globalization/CultureData.Windows.cs | 2 +- .../src/System/Globalization/CultureData.cs | 2 +- .../ManifestBasedResourceGroveler.cs | 2 +- .../Text/EncoderLatin1BestFitFallback.Data.cs | 2 +- ...bleThreadPool.CpuUtilizationReader.Unix.cs | 2 +- ...ThreadPool.CpuUtilizationReader.Windows.cs | 2 +- .../PortableThreadPool.GateThread.cs | 2 +- ...PortableThreadPool.HillClimbing.Complex.cs | 4 +- .../PortableThreadPool.HillClimbing.cs | 4 +- .../PortableThreadPool.ThreadCounts.cs | 2 +- .../PortableThreadPool.WaitThread.cs | 2 +- .../PortableThreadPool.WorkerThread.cs | 2 +- .../PortableThreadPool.WorkerTracking.cs | 2 +- .../src/System/Threading/SpinLock.cs | 2 +- .../src/System/Threading/Timer.cs | 2 +- .../System/Threading/TimerQueue.Portable.cs | 2 +- .../src/System/Threading/TimerQueue.Unix.cs | 2 +- .../System/Threading/TimerQueue.Windows.cs | 2 +- .../Runtime/Serialization/Attributes.cs | 2 +- .../Serialization/BitFlagsGenerator.cs | 2 +- .../Serialization/ClassDataContract.cs | 4 +- .../Runtime/Serialization/CodeGenerator.cs | 10 +-- .../Serialization/CollectionDataContract.cs | 6 +- .../Runtime/Serialization/DataContract.cs | 8 +- .../Runtime/Serialization/DataMember.cs | 2 +- .../Serialization/ExtensionDataObject.cs | 12 +-- .../Serialization/ExtensionDataReader.cs | 6 +- .../Serialization/HybridObjectCache.cs | 2 +- .../Json/ByteArrayHelperWithString.cs | 2 +- .../Json/JsonByteArrayDataContract.cs | 2 +- .../Json/JsonClassDataContract.cs | 2 +- .../Json/JsonCollectionDataContract.cs | 2 +- .../Serialization/Json/JsonDataContract.cs | 2 +- .../Json/JsonEncodingStreamWrapper.cs | 2 +- .../Json/JsonEnumDataContract.cs | 2 +- .../Json/JsonFormatWriterGenerator.cs | 2 +- .../Json/JsonObjectDataContract.cs | 2 +- .../Json/JsonQNameDataContract.cs | 2 +- .../Serialization/Json/JsonReaderDelegator.cs | 2 +- .../Json/JsonStringDataContract.cs | 2 +- .../Serialization/Json/JsonUriDataContract.cs | 2 +- .../Serialization/Json/JsonWriterDelegator.cs | 2 +- .../Serialization/Json/JsonXmlDataContract.cs | 2 +- .../Json/ReflectionJsonFormatWriter.cs | 4 +- .../Serialization/Json/XmlJsonReader.cs | 2 +- .../Serialization/Json/XmlJsonWriter.cs | 2 +- ...lObjectSerializerReadContextComplexJson.cs | 2 +- ...ObjectSerializerWriteContextComplexJson.cs | 2 +- .../Runtime/Serialization/ObjectToIdCache.cs | 2 +- .../Serialization/PrimitiveDataContract.cs | 90 +++++++++---------- .../ReflectionXmlFormatWriter.cs | 2 +- .../Runtime/Serialization/SchemaExporter.cs | 2 +- .../Serialization/XmlSerializableReader.cs | 2 +- .../Serialization/XmlSerializableWriter.cs | 2 +- .../src/System/Text/Base64Encoding.cs | 4 +- .../src/System/Text/BinHexEncoding.cs | 2 +- .../src/System/Xml/ArrayHelper.cs | 40 ++++----- .../src/System/Xml/EncodingStreamWrapper.cs | 2 +- .../src/System/Xml/PrefixHandle.cs | 2 +- .../src/System/Xml/StringHandle.cs | 2 +- .../src/System/Xml/ValueHandle.cs | 2 +- .../src/System/Xml/XmlBinaryReader.cs | 2 +- .../src/System/Xml/XmlBinaryWriter.cs | 4 +- .../src/System/Xml/XmlBufferReader.cs | 2 +- .../Xml/XmlDictionaryAsyncCheckWriter.cs | 2 +- .../src/System/Xml/XmlSigningNodeWriter.cs | 2 +- .../src/System/Xml/XmlUTF8TextReader.cs | 2 +- .../src/System/Xml/XmlUTF8TextWriter.cs | 2 +- .../src/System/Xml/Linq/BaseUriAnnotation.cs | 2 +- .../Xml/Linq/LineInfoEndElementAnnotation.cs | 2 +- .../src/System/Xml/Linq/XNodeBuilder.cs | 2 +- .../src/System/Xml/Linq/XNodeReader.cs | 2 +- .../Xml/Linq/XObjectChangeAnnotation.cs | 2 +- .../src/System/Xml/Schema/XNodeValidator.cs | 4 +- .../src/System/Xml/XPath/XNodeNavigator.cs | 2 +- .../src/System/Xml/Base64Decoder.cs | 2 +- .../src/System/Xml/Base64Encoder.cs | 4 +- .../src/System/Xml/Base64EncoderAsync.cs | 4 +- .../src/System/Xml/BinHexDecoder.cs | 2 +- .../src/System/Xml/BitStack.cs | 2 +- .../src/System/Xml/ByteStack.cs | 2 +- .../System/Xml/Cache/XPathDocumentIterator.cs | 8 +- .../Xml/Core/CharEntityEncoderFallback.cs | 4 +- .../Xml/Core/HtmlEncodedRawTextWriter.cs | 2 +- .../System/Xml/Core/HtmlUtf8RawTextWriter.cs | 2 +- .../Xml/Core/IncrementalReadDecoders.cs | 4 +- .../Xml/Core/LocalAppContextSwitches.cs | 2 +- .../src/System/Xml/Core/QueryOutputWriter.cs | 2 +- .../System/Xml/Core/QueryOutputWriterV1.cs | 2 +- .../Xml/Core/ReadContentAsBinaryHelper.cs | 2 +- .../Core/ReadContentAsBinaryHelperAsync.cs | 2 +- .../System/Xml/Core/ReadOnlyTernaryTree.cs | 2 +- .../Xml/Core/TextEncodedRawTextWriter.cs | 2 +- .../System/Xml/Core/TextUtf8RawTextWriter.cs | 2 +- .../Xml/Core/ValidatingReaderNodeData.cs | 2 +- .../System/Xml/Core/XmlAsyncCheckReader.cs | 4 +- .../System/Xml/Core/XmlAsyncCheckWriter.cs | 2 +- .../System/Xml/Core/XmlAutoDetectWriter.cs | 2 +- .../System/Xml/Core/XmlCharCheckingReader.cs | 2 +- .../System/Xml/Core/XmlCharCheckingWriter.cs | 2 +- .../Xml/Core/XmlCharCheckingWriterAsync.cs | 2 +- .../src/System/Xml/Core/XmlTextEncoder.cs | 2 +- .../System/Xml/Core/XmlTextReaderImpl.Unix.cs | 2 +- .../src/System/Xml/Core/XmlTextReaderImpl.cs | 2 +- .../System/Xml/Core/XmlTextReaderImplAsync.cs | 2 +- .../Xml/Core/XmlTextReaderImplHelpers.cs | 4 +- .../Xml/Core/XmlTextReaderImplHelpersAsync.cs | 4 +- .../Xml/Core/XmlValidatingReaderImpl.cs | 2 +- .../System/Xml/Core/XmlWellFormedWriter.cs | 2 +- .../Xml/Core/XmlWellFormedWriterAsync.cs | 2 +- .../Xml/Core/XmlWellFormedWriterHelpers.cs | 4 +- .../Core/XmlWellFormedWriterHelpersAsync.cs | 4 +- .../src/System/Xml/Core/XsdCachingReader.cs | 2 +- .../System/Xml/Core/XsdCachingReaderAsync.cs | 2 +- .../System/Xml/Core/XsdValidatingReader.cs | 4 +- .../Xml/Core/XsdValidatingReaderAsync.cs | 2 +- .../src/System/Xml/Dom/DomNameTable.cs | 2 +- .../src/System/Xml/Dom/XPathNodeList.cs | 4 +- .../src/System/Xml/Dom/XmlChildNodes.cs | 2 +- .../src/System/Xml/Dom/XmlDomTextWriter.cs | 2 +- .../src/System/Xml/Dom/XmlElementList.cs | 10 +-- .../src/System/Xml/Dom/XmlLoader.cs | 2 +- .../src/System/Xml/Dom/XmlNodeReader.cs | 2 +- .../System/Xml/Dom/XmlUnspecifiedAttribute.cs | 4 +- .../src/System/Xml/HWStack.cs | 2 +- .../src/System/Xml/IXmlLineInfo.cs | 2 +- .../src/System/Xml/MTNameTable.cs | 4 +- .../src/System/Xml/Schema/Asttree.cs | 10 +-- .../src/System/Xml/Schema/AutoValidator.cs | 2 +- .../src/System/Xml/Schema/Chameleonkey.cs | 2 +- .../Xml/Schema/CompiledidEntityConstraint.cs | 2 +- .../src/System/Xml/Schema/ConstraintStruct.cs | 10 +-- .../src/System/Xml/Schema/ContentValidator.cs | 14 +-- .../Xml/Schema/DataTypeImplementation.cs | 82 ++++++++--------- .../src/System/Xml/Schema/DtdParser.cs | 2 +- .../src/System/Xml/Schema/DtdParserAsync.cs | 2 +- .../src/System/Xml/Schema/FacetChecker.cs | 20 ++--- .../src/System/Xml/Schema/NamespaceList.cs | 2 +- .../src/System/Xml/Schema/Preprocessor.cs | 2 +- .../src/System/Xml/Schema/SchemaInfo.cs | 2 +- .../Xml/Schema/SchemaNamespacemanager.cs | 2 +- .../System/Xml/Schema/XmlSchemaObjectTable.cs | 6 +- .../Xml/Schema/XmlSchemaSubstitutionGroup.cs | 2 +- .../System/Xml/Schema/XmlSchemaValidator.cs | 2 +- .../Xml/Schema/XmlUntypedStringConverter.cs | 2 +- .../System/Xml/Schema/XmlValueConverter.cs | 42 ++++----- .../System/Xml/Serialization/CodeGenerator.cs | 16 ++-- .../Xml/Serialization/CodeIdentifiers.cs | 2 +- .../System/Xml/Serialization/Compilation.cs | 8 +- .../src/System/Xml/Serialization/Compiler.cs | 2 +- .../System/Xml/Serialization/ImportContext.cs | 4 +- .../src/System/Xml/Serialization/Mappings.cs | 30 +++---- .../src/System/Xml/Serialization/Models.cs | 16 ++-- .../src/System/Xml/Serialization/NameTable.cs | 4 +- .../Serialization/PrimitiveXmlSerializers.cs | 4 +- .../ReflectionXmlSerializationReader.cs | 10 +-- .../ReflectionXmlSerializationWriter.cs | 2 +- .../Xml/Serialization/SchemaObjectWriter.cs | 22 ++--- .../System/Xml/Serialization/SourceInfo.cs | 2 +- .../src/System/Xml/Serialization/Types.cs | 4 +- .../Serialization/XmlReflectionImporter.cs | 6 +- .../Xml/Serialization/XmlSchemaImporter.cs | 2 +- .../XmlSerializationEventSource.cs | 2 +- .../Serialization/XmlSerializationReader.cs | 2 +- .../XmlSerializationReaderILGen.cs | 2 +- .../Serialization/XmlSerializationWriter.cs | 6 +- .../XmlSerializationWriterILGen.cs | 4 +- .../Xml/Serialization/indentedWriter.cs | 2 +- .../Xml/XPath/Internal/DescendantQuery.cs | 2 +- .../src/System/Xml/XPath/Internal/Filter.cs | 2 +- .../src/System/Xml/XPath/Internal/Function.cs | 2 +- .../src/System/Xml/XPath/Internal/Group.cs | 2 +- .../Xml/XPath/Internal/IteratorFilter.cs | 2 +- .../src/System/Xml/XPath/Internal/Operand.cs | 2 +- .../src/System/Xml/XPath/Internal/Operator.cs | 2 +- .../Xml/XPath/Internal/PreSiblingQuery.cs | 4 +- .../src/System/Xml/XPath/Internal/Root.cs | 2 +- .../src/System/Xml/XPath/Internal/Variable.cs | 2 +- .../XPath/Internal/XPathAncestorIterator.cs | 2 +- .../Xml/XPath/Internal/XPathChildIterator.cs | 2 +- .../XPath/Internal/XPathDescendantIterator.cs | 2 +- .../Xml/XPath/Internal/XPathMultyIterator.cs | 8 +- .../System/Xml/XPath/Internal/XPathParser.cs | 2 +- .../XPath/Internal/XPathSelectionIterator.cs | 4 +- .../XPath/Internal/XPathSingletonIterator.cs | 2 +- .../Xml/XPath/XPathNavigatorKeyComparer.cs | 2 +- .../System/Xml/XPath/XPathNavigatorReader.cs | 20 ++--- .../src/System/Xml/XmlDownloadManager.cs | 2 +- .../src/System/Xml/XmlDownloadManagerAsync.cs | 2 +- .../src/System/Xml/XmlEncoding.cs | 12 +-- .../src/System/Xml/XmlNullResolver.cs | 2 +- .../System/Xml/Xsl/IlGen/GenerateHelper.cs | 4 +- .../Xml/Xsl/IlGen/IteratorDescriptor.cs | 4 +- .../System/Xml/Xsl/IlGen/OptimizerPatterns.cs | 4 +- .../System/Xml/Xsl/IlGen/StaticDataManager.cs | 4 +- .../System/Xml/Xsl/IlGen/XmlILAnnotation.cs | 2 +- .../Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs | 8 +- .../src/System/Xml/Xsl/IlGen/XmlILModule.cs | 2 +- .../Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs | 8 +- .../src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilChoice.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilDataSource.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilExpression.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilFunction.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilInvoke.cs | 2 +- .../System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs | 2 +- .../System/Xml/Xsl/QIL/QilInvokeLateBound.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilList.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilLoop.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilName.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilParameter.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilSortKey.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilStrConcat.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilTargetType.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilTypeChecker.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilUnary.cs | 2 +- .../Xml/Xsl/QIL/QilValidationVisitor.cs | 12 +-- .../src/System/Xml/Xsl/QIL/QilVisitor.cs | 2 +- .../src/System/Xml/Xsl/QIL/QilXmlWriter.cs | 14 +-- .../src/System/Xml/Xsl/QueryReaderSettings.cs | 2 +- .../Xml/Xsl/Runtime/DecimalFormatter.cs | 4 +- .../Xml/Xsl/Runtime/DocumentOrderComparer.cs | 2 +- .../Xml/Xsl/Runtime/WhitespaceRuleLookup.cs | 2 +- .../Xml/Xsl/Runtime/WhitespaceRuleReader.cs | 2 +- .../Xml/Xsl/Runtime/XmlExtensionFunction.cs | 4 +- .../Xml/Xsl/Runtime/XmlNavigatorFilter.cs | 8 +- .../System/Xml/Xsl/Runtime/XmlQueryContext.cs | 2 +- .../Xml/Xsl/Runtime/XmlQueryStaticData.cs | 6 +- .../Xml/Xsl/Runtime/XmlSequenceWriter.cs | 4 +- .../src/System/Xml/Xsl/Runtime/XmlSortKey.cs | 12 +-- .../src/System/Xml/Xsl/Runtime/XslNumber.cs | 4 +- .../src/System/Xml/Xsl/SourceLineInfo.cs | 10 +-- .../src/System/Xml/Xsl/XPath/XPathBuilder.cs | 4 +- .../Xml/Xsl/XPath/XPathCompileException.cs | 2 +- .../src/System/Xml/Xsl/XPath/XPathContext.cs | 2 +- .../src/System/Xml/Xsl/XPath/XPathParser.cs | 2 +- .../src/System/Xml/Xsl/XmlILCommand.cs | 2 +- .../src/System/Xml/Xsl/XmlIlGenerator.cs | 2 +- .../System/Xml/Xsl/XmlQualifiedNameTest.cs | 2 +- .../src/System/Xml/Xsl/Xslt/Compiler.cs | 12 +-- .../src/System/Xml/Xsl/Xslt/CompilerError.cs | 4 +- .../System/Xml/Xsl/Xslt/InvokeGenerator.cs | 2 +- .../System/Xml/Xsl/Xslt/KeyMatchBuilder.cs | 6 +- .../src/System/Xml/Xsl/Xslt/Keywords.cs | 2 +- .../src/System/Xml/Xsl/Xslt/MatcherBuilder.cs | 8 +- .../System/Xml/Xsl/Xslt/OutputScopeManager.cs | 2 +- .../src/System/Xml/Xsl/Xslt/QilGenerator.cs | 4 +- .../System/Xml/Xsl/Xslt/QilGeneratorEnv.cs | 2 +- .../System/Xml/Xsl/Xslt/QilStrConcatenator.cs | 2 +- .../src/System/Xml/Xsl/Xslt/Scripts.cs | 4 +- .../src/System/Xml/Xsl/Xslt/Stylesheet.cs | 2 +- .../Xml/Xsl/Xslt/XPathPatternBuilder.cs | 6 +- .../System/Xml/Xsl/Xslt/XPathPatternParser.cs | 2 +- .../src/System/Xml/Xsl/Xslt/XslAst.cs | 22 ++--- .../src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs | 26 +++--- .../src/System/Xml/Xsl/Xslt/XsltInput.cs | 6 +- .../src/System/Xml/Xsl/Xslt/XsltLoader.cs | 2 +- .../src/System/Xml/Xsl/Xslt/XsltQilFactory.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/ActionFrame.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/BuilderInfo.cs | 2 +- .../System/Xml/Xsl/XsltOld/ChooseAction.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/Compiler.cs | 4 +- .../System/Xml/Xsl/XsltOld/ContainerAction.cs | 2 +- .../System/Xml/Xsl/XsltOld/CopyCodeAction.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/DbgCompiler.cs | 8 +- .../src/System/Xml/Xsl/XsltOld/EndEvent.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/HtmlProps.cs | 4 +- .../src/System/Xml/Xsl/XsltOld/InputScope.cs | 2 +- .../Xml/Xsl/XsltOld/InputScopeManager.cs | 2 +- .../System/Xml/Xsl/XsltOld/NameSpaceEvent.cs | 2 +- .../System/Xml/Xsl/XsltOld/NamespaceDecl.cs | 2 +- .../System/Xml/Xsl/XsltOld/NavigatorInput.cs | 2 +- .../System/Xml/Xsl/XsltOld/NumberAction.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/OutKeywords.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/OutputScope.cs | 2 +- .../Xml/Xsl/XsltOld/OutputScopeManager.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/Processor.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/RootAction.cs | 2 +- .../System/Xml/Xsl/XsltOld/StateMachine.cs | 2 +- .../System/Xml/Xsl/XsltOld/StringOutput.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/Stylesheet.cs | 2 +- .../Xml/Xsl/XsltOld/TemplateLookupAction.cs | 2 +- .../System/Xml/Xsl/XsltOld/TemplateManager.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/TextOutput.cs | 2 +- .../System/Xml/Xsl/XsltOld/ValueOfAction.cs | 2 +- .../Xml/Xsl/XsltOld/XsltCompileContext.cs | 2 +- .../src/System/Xml/Xsl/XsltOld/XsltOutput.cs | 2 +- .../Context/Custom/CustomAssembly.cs | 2 +- .../Context/Custom/CustomConstructorInfo.cs | 2 +- .../Context/Custom/CustomEventInfo.cs | 2 +- .../Context/Custom/CustomFieldInfo.cs | 2 +- .../Context/Custom/CustomMethodInfo.cs | 2 +- .../Reflection/Context/Custom/CustomModule.cs | 2 +- .../Context/Custom/CustomParameterInfo.cs | 2 +- .../Context/Custom/CustomPropertyInfo.cs | 2 +- .../Reflection/Context/Custom/CustomType.cs | 2 +- .../Context/CustomReflectionContext.cs | 2 +- .../ProjectingCustomAttributeData.cs | 2 +- .../ProjectingExceptionHandlingClause.cs | 2 +- .../Projection/ProjectingLocalVariableInfo.cs | 2 +- .../ProjectingManifestResourceInfo.cs | 2 +- .../Projection/ProjectingMethodBody.cs | 2 +- .../Context/Virtual/InheritedMethodInfo.cs | 2 +- .../Context/Virtual/InheritedPropertyInfo.cs | 2 +- .../VirtualPropertyInfo.PropertyGetter.cs | 2 +- .../VirtualPropertyInfo.PropertySetter.cs | 2 +- .../Context/Virtual/VirtualPropertyInfo.cs | 2 +- .../Context/Virtual/VirtualReturnParameter.cs | 2 +- .../Internal/Utilities/PooledStringBuilder.cs | 2 +- .../Metadata/Internal/NamespaceCache.cs | 2 +- .../Extensions/DeserializingResourceReader.cs | 2 +- .../Extensions/PreserializedResourceWriter.cs | 2 +- .../src/System/Runtime/Caching/CacheUsage.cs | 2 +- .../Caching/FileChangeNotificationSystem.cs | 4 +- .../Runtime/Caching/MemoryCacheEntry.cs | 2 +- .../Caching/MemoryCacheKeyEqualityComparer.cs | 2 +- .../src/System/Runtime/Caching/SRef.cs | 4 +- .../FormatProvider.NumberBuffer.cs | 2 +- .../Cryptography/AesImplementation.OSX.cs | 2 +- .../Cryptography/AesImplementation.Unix.cs | 2 +- .../Cryptography/AesImplementation.Windows.cs | 2 +- .../Cryptography/DesImplementation.OSX.cs | 2 +- .../Cryptography/DesImplementation.Unix.cs | 2 +- .../Cryptography/DesImplementation.Windows.cs | 2 +- .../Internal/Cryptography/OpenSslCipher.cs | 2 +- .../Cryptography/RC2Implementation.OSX.cs | 2 +- .../Cryptography/RC2Implementation.Unix.cs | 2 +- .../Cryptography/RC2Implementation.Windows.cs | 2 +- ...omNumberGeneratorImplementation.Browser.cs | 2 +- ...RandomNumberGeneratorImplementation.OSX.cs | 2 +- ...andomNumberGeneratorImplementation.Unix.cs | 2 +- ...omNumberGeneratorImplementation.Windows.cs | 2 +- .../TripleDesImplementation.OSX.cs | 2 +- .../TripleDesImplementation.Unix.cs | 2 +- .../TripleDesImplementation.Windows.cs | 2 +- .../Security/Cryptography/AesAEAD.Windows.cs | 2 +- .../Security/Cryptography/CngKeyLite.cs | 6 +- .../Cryptography/AsnFormatter.Managed.cs | 2 +- .../Cryptography/Pkcs/CmsSignature.ECDsa.cs | 2 +- .../src/Internal/Cryptography/FindPal.cs | 2 +- .../Cryptography/Pal.Android/X509Pal.cs | 2 +- .../Internal/Cryptography/Pal.OSX/X509Pal.cs | 2 +- .../Cryptography/Pal.Windows/FindPal.cs | 2 +- .../Pkcs10CertificationRequestInfo.cs | 2 +- .../Cryptography/Xml/AttributeSortOrder.cs | 2 +- .../C14NAncestralNamespaceContextManager.cs | 2 +- .../Security/Cryptography/Xml/CanonicalXml.cs | 2 +- .../Cryptography/Xml/CanonicalXmlAttribute.cs | 2 +- .../Xml/CanonicalXmlCDataSection.cs | 2 +- .../Cryptography/Xml/CanonicalXmlComment.cs | 2 +- .../Cryptography/Xml/CanonicalXmlDocument.cs | 2 +- .../Cryptography/Xml/CanonicalXmlElement.cs | 2 +- .../Xml/CanonicalXmlEntityReference.cs | 2 +- .../Cryptography/Xml/CanonicalXmlNodeList.cs | 2 +- .../Xml/CanonicalXmlProcessingInstruction.cs | 2 +- .../Xml/CanonicalXmlSignificantWhitespace.cs | 2 +- .../Cryptography/Xml/CanonicalXmlText.cs | 2 +- .../Xml/CanonicalXmlWhitespace.cs | 2 +- .../Xml/DSASignatureDescription.cs | 2 +- .../ExcAncestralNamespaceContextManager.cs | 2 +- .../Cryptography/Xml/ExcCanonicalXml.cs | 2 +- .../Cryptography/Xml/MyXmlDocument.cs | 2 +- .../Cryptography/Xml/NamespaceFrame.cs | 2 +- .../Cryptography/Xml/NamespaceSortOrder.cs | 2 +- .../Xml/RSAPKCS1SHA1SignatureDescription.cs | 2 +- .../Xml/RSAPKCS1SHA256SignatureDescription.cs | 2 +- .../Xml/RSAPKCS1SHA384SignatureDescription.cs | 2 +- .../Xml/RSAPKCS1SHA512SignatureDescription.cs | 2 +- .../System/Security/Principal/IRCollection.cs | 2 +- .../ServiceModel/Channels/UriGenerator.cs | 2 +- .../Syndication/NullNotAllowedCollection.cs | 2 +- .../src/System/ServiceModel/XmlBuffer.cs | 2 +- .../src/System/Text/DBCSCodePageEncoding.cs | 2 +- .../src/System/Text/EUCJPEncoding.cs | 2 +- .../src/System/Text/EncoderBestFitFallback.cs | 2 +- .../src/System/Text/EncodingByteBuffer.cs | 2 +- .../src/System/Text/EncodingCharBuffer.cs | 2 +- .../src/System/Text/ISCIIEncoding.cs | 6 +- .../src/System/Text/ISO2022Encoding.cs | 6 +- .../src/System/Text/SBCSCodePageEncoding.cs | 2 +- .../Text/Json/Serialization/ArgumentState.cs | 2 +- .../Collection/IEnumerableConverterFactory.cs | 2 +- .../Object/ObjectConverterFactory.cs | 2 +- .../Converters/Value/EnumConverter.cs | 2 +- .../Converters/Value/NullableConverter.cs | 2 +- .../Value/NullableConverterFactory.cs | 2 +- .../Serialization/JsonDefaultNamingPolicy.cs | 2 +- .../Serialization/JsonParameterInfoOfT.cs | 2 +- .../src/Internal/Common.cs | 2 +- .../Threading/Tasks/ParallelLoopState.cs | 8 +- .../Threading/Tasks/ParallelRangeManager.cs | 2 +- .../System/Threading/Tasks/TaskReplicator.cs | 2 +- .../Transactions/DistributedTransaction.cs | 6 +- .../Transactions/DurableEnlistmentState.cs | 10 +-- .../src/System/Transactions/Enlistment.cs | 6 +- .../System/Transactions/EnlistmentState.cs | 2 +- .../Transactions/InternalTransaction.cs | 4 +- .../src/System/Transactions/Transaction.cs | 4 +- .../System/Transactions/TransactionState.cs | 56 ++++++------ .../System/Transactions/TransactionTable.cs | 8 +- .../VolatileEnlistmentMultiplexing.cs | 4 +- .../Transactions/VolatileEnlistmentState.cs | 18 ++-- .../X509Certificates/SafeX509Handles.cs | 2 +- 969 files changed, 1569 insertions(+), 1564 deletions(-) diff --git a/docs/coding-guidelines/coding-style.md b/docs/coding-guidelines/coding-style.md index 38cc58c620aa7..856ce8f5bb4ea 100644 --- a/docs/coding-guidelines/coding-style.md +++ b/docs/coding-guidelines/coding-style.md @@ -23,7 +23,7 @@ The general rule we follow is "use Visual Studio defaults". Consider enabling "View White Space (Ctrl+R, Ctrl+W)" or "Edit -> Advanced -> View White Space" if using Visual Studio to aid detection. 9. If a file happens to differ in style from these guidelines (e.g. private members are named `m_member` rather than `_member`), the existing style in that file takes precedence. -10. We only use `var` when it's obvious what the variable type is (e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`). +10. We only use `var` when the type is explicitly named on the right-hand side, typically due to either `new` or an explicit cast, e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`. 11. We use language keywords instead of BCL types (e.g. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (e.g. `int.Parse` instead of `Int32.Parse`). See issue [#13976](https://github.com/dotnet/runtime/issues/13976) for examples. 12. We use PascalCasing to name all our constant local variables and fields. The only exception is for interop code where the constant value should exactly match the name and value of the code you are calling via interop. 13. We use PascalCasing for all method names, including local functions. @@ -35,6 +35,7 @@ The general rule we follow is "use Visual Studio defaults". - Never use single-line form (for example: `if (source == null) throw new ArgumentNullException("source");`) - Using braces is always accepted, and required if any block of an `if`/`else if`/.../`else` compound statement uses braces or if a single statement body spans multiple lines. - Braces may be omitted only if the body of *every* block associated with an `if`/`else if`/.../`else` compound statement is placed on a single line. +19. Make all internal and private types static or sealed unless derivation from them is required. As with any implementation detail, they can be changed if/when derivation is required in the future. An [EditorConfig](https://editorconfig.org "EditorConfig homepage") file (`.editorconfig`) has been provided at the root of the runtime repository, enabling C# auto-formatting conforming to the above guidelines. diff --git a/src/coreclr/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.CoreCLR.cs index da6adab43e2f2..0959bc67f47f8 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.CoreCLR.cs @@ -13,7 +13,7 @@ internal interface IArraySortHelper } [TypeDependency("System.Collections.Generic.GenericArraySortHelper`1")] - internal partial class ArraySortHelper + internal sealed partial class ArraySortHelper : IArraySortHelper { private static readonly IArraySortHelper s_defaultArraySortHelper = CreateArraySortHelper(); @@ -37,7 +37,7 @@ private static IArraySortHelper CreateArraySortHelper() } } - internal partial class GenericArraySortHelper + internal sealed partial class GenericArraySortHelper : IArraySortHelper { } @@ -48,7 +48,7 @@ internal interface IArraySortHelper } [TypeDependency("System.Collections.Generic.GenericArraySortHelper`2")] - internal partial class ArraySortHelper + internal sealed partial class ArraySortHelper : IArraySortHelper { private static readonly IArraySortHelper s_defaultArraySortHelper = CreateArraySortHelper(); @@ -72,7 +72,7 @@ private static IArraySortHelper CreateArraySortHelper() } } - internal partial class GenericArraySortHelper + internal sealed partial class GenericArraySortHelper : IArraySortHelper { } diff --git a/src/coreclr/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.CoreCLR.cs index 1a7444ebae8ee..05805072cd7cf 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.CoreCLR.cs @@ -6,7 +6,7 @@ namespace System.Resources { - internal partial class ManifestBasedResourceGroveler + internal sealed partial class ManifestBasedResourceGroveler { // Internal version of GetSatelliteAssembly that avoids throwing FileNotFoundException private static Assembly? InternalGetSatelliteAssembly(Assembly mainAssembly, diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs index e13cd3afe2474..ca4975f59229e 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Timer.CoreCLR.cs @@ -8,7 +8,7 @@ namespace System.Threading { - internal partial class TimerQueue + internal sealed partial class TimerQueue { #region interface to native per-AppDomain timer diff --git a/src/libraries/Common/src/Extensions/EmptyDisposable.cs b/src/libraries/Common/src/Extensions/EmptyDisposable.cs index 322df0fea85fd..1dbaef4237e29 100644 --- a/src/libraries/Common/src/Extensions/EmptyDisposable.cs +++ b/src/libraries/Common/src/Extensions/EmptyDisposable.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.FileProviders { - internal class EmptyDisposable : IDisposable + internal sealed class EmptyDisposable : IDisposable { public static EmptyDisposable Instance { get; } = new EmptyDisposable(); diff --git a/src/libraries/Common/src/Extensions/Logging/NullExternalScopeProvider.cs b/src/libraries/Common/src/Extensions/Logging/NullExternalScopeProvider.cs index 791ecc87152cd..5c50de4dd6207 100644 --- a/src/libraries/Common/src/Extensions/Logging/NullExternalScopeProvider.cs +++ b/src/libraries/Common/src/Extensions/Logging/NullExternalScopeProvider.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Logging /// /// Scope provider that does nothing. /// - internal class NullExternalScopeProvider : IExternalScopeProvider + internal sealed class NullExternalScopeProvider : IExternalScopeProvider { private NullExternalScopeProvider() { diff --git a/src/libraries/Common/src/Extensions/Logging/NullScope.cs b/src/libraries/Common/src/Extensions/Logging/NullScope.cs index 14f92fbe72aee..7748734de07be 100644 --- a/src/libraries/Common/src/Extensions/Logging/NullScope.cs +++ b/src/libraries/Common/src/Extensions/Logging/NullScope.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging /// /// An empty scope without any logic /// - internal class NullScope : IDisposable + internal sealed class NullScope : IDisposable { public static NullScope Instance { get; } = new NullScope(); diff --git a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs index ae4840f7e457e..133dc3ec445d1 100644 --- a/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/Android/System.Security.Cryptography.Native.Android/Interop.Ssl.cs @@ -12,7 +12,7 @@ internal static partial class AndroidCrypto [DllImport(Interop.Libraries.CryptoNative, EntryPoint = "AndroidCryptoNative_SSLStreamRelease")] internal static extern void SSLStreamRelease(IntPtr ptr); - internal class SslException : Exception + internal sealed class SslException : Exception { internal SslException() { diff --git a/src/libraries/Common/src/Interop/Interop.Ldap.cs b/src/libraries/Common/src/Interop/Interop.Ldap.cs index c40aa55fcdc67..4ff3fd17eed9b 100644 --- a/src/libraries/Common/src/Interop/Interop.Ldap.cs +++ b/src/libraries/Common/src/Interop/Interop.Ldap.cs @@ -15,7 +15,7 @@ internal static partial class Interop namespace System.DirectoryServices.Protocols { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal class Luid + internal sealed class Luid { private readonly int _lowPart; private readonly int _highPart; diff --git a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs index 74a5ee3d14c15..392add014ed6a 100644 --- a/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs +++ b/src/libraries/Common/src/Interop/Linux/OpenLdap/Interop.Ldap.cs @@ -27,7 +27,7 @@ internal struct SaslDefaultCredentials /// where we will have to resolve the result. /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal class SaslInteractiveChallenge + internal sealed class SaslInteractiveChallenge { public ulong saslChallengeType; public string challenge; diff --git a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs index 1b1e3e8f168ce..c4d4a21fa455a 100644 --- a/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs +++ b/src/libraries/Common/src/Interop/OSX/Interop.CoreFoundation.CFProxy.cs @@ -45,7 +45,7 @@ internal struct CFStreamClientContext public IntPtr CopyDescription; } - internal class CFProxy + internal sealed class CFProxy { private SafeCFDictionaryHandle _dictionary; diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SslErr.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SslErr.cs index 424453447e9ac..523f197a69ce0 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SslErr.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.SslErr.cs @@ -7,7 +7,7 @@ internal static partial class Interop { internal static partial class AppleCrypto { - internal class SslException : Exception + internal sealed class SslException : Exception { internal SslException() { diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS.cs index 092e4701a820b..958335fd991f7 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class Advapi32 { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal class ENUM_SERVICE_STATUS + internal sealed class ENUM_SERVICE_STATUS { internal string? serviceName; internal string? displayName; diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS_PROCESS.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS_PROCESS.cs index 2dc6933e6f2b2..09afde186a0e8 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS_PROCESS.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.ENUM_SERVICE_STATUS_PROCESS.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class Advapi32 { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal class ENUM_SERVICE_STATUS_PROCESS + internal sealed class ENUM_SERVICE_STATUS_PROCESS { internal string? serviceName; internal string? displayName; diff --git a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs index 6c9b8748919f3..976a6396118e1 100644 --- a/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs +++ b/src/libraries/Common/src/Interop/Windows/CryptUI/Interop.CryptUIDlgCertificate.cs @@ -10,7 +10,7 @@ internal static partial class Interop internal static partial class CryptUI { [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal class CRYPTUI_VIEWCERTIFICATE_STRUCTW + internal sealed class CRYPTUI_VIEWCERTIFICATE_STRUCTW { internal uint dwSize; internal IntPtr hwndParent; @@ -33,7 +33,7 @@ internal class CRYPTUI_VIEWCERTIFICATE_STRUCTW } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal class CRYPTUI_SELECTCERTIFICATE_STRUCTW + internal sealed class CRYPTUI_SELECTCERTIFICATE_STRUCTW { internal uint dwSize; internal IntPtr hwndParent; diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecurityPackageInfoClass.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecurityPackageInfoClass.cs index dc18d92c3463d..ea65be9600eba 100644 --- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecurityPackageInfoClass.cs +++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecurityPackageInfoClass.cs @@ -7,7 +7,7 @@ namespace System.Net { // _SecPkgInfoW in sspi.h. - internal class SecurityPackageInfoClass + internal sealed class SecurityPackageInfoClass { internal int Capabilities; internal short Version; diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs index f97f85224fda7..1bcbc116c8a29 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.MMCKINFO.cs @@ -8,7 +8,7 @@ internal static partial class Interop internal static partial class WinMM { [StructLayout(LayoutKind.Sequential)] - internal class MMCKINFO + internal sealed class MMCKINFO { internal int ckID; internal int cksize; diff --git a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs index 38b257ae3a1d6..3fb30c873de64 100644 --- a/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs +++ b/src/libraries/Common/src/Interop/Windows/WinMm/Interop.mmioRead.cs @@ -9,7 +9,7 @@ internal static partial class Interop internal static partial class WinMM { [StructLayout(LayoutKind.Sequential)] - internal class WAVEFORMATEX + internal sealed class WAVEFORMATEX { internal short wFormatTag; internal short nChannels; diff --git a/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs b/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs index 5144111b7652d..cbe065b5a5a4b 100644 --- a/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs +++ b/src/libraries/Common/src/System/CodeDom/CodeTypeReference.cs @@ -25,7 +25,7 @@ internal enum CodeTypeReferenceOptions #if !FEATURE_SERIALIZATION public class CodeTypeReference : CodeObject #else - internal class CodeTypeReference : CodeObject + internal sealed class CodeTypeReference : CodeObject #endif { private string? _baseType; diff --git a/src/libraries/Common/src/System/CodeDom/CodeTypeReferenceCollection.cs b/src/libraries/Common/src/System/CodeDom/CodeTypeReferenceCollection.cs index 7705d998afc88..92df60156f9be 100644 --- a/src/libraries/Common/src/System/CodeDom/CodeTypeReferenceCollection.cs +++ b/src/libraries/Common/src/System/CodeDom/CodeTypeReferenceCollection.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization #if !FEATURE_SERIALIZATION public class CodeTypeReferenceCollection : CollectionBase #else - internal class CodeTypeReferenceCollection : CollectionBase + internal sealed class CodeTypeReferenceCollection : CollectionBase #endif { public CodeTypeReferenceCollection() { } diff --git a/src/libraries/Common/src/System/Data/Common/DbConnectionPoolKey.cs b/src/libraries/Common/src/System/Data/Common/DbConnectionPoolKey.cs index 6c5a567cf7ad7..6e3601ae81398 100644 --- a/src/libraries/Common/src/System/Data/Common/DbConnectionPoolKey.cs +++ b/src/libraries/Common/src/System/Data/Common/DbConnectionPoolKey.cs @@ -5,7 +5,7 @@ namespace System.Data.Common { // DbConnectionPoolKey: Base class implementation of a key to connection pool groups // Only connection string is used as a key - internal class DbConnectionPoolKey : ICloneable + internal sealed class DbConnectionPoolKey : ICloneable { private string? _connectionString; @@ -14,17 +14,17 @@ internal DbConnectionPoolKey(string? connectionString) _connectionString = connectionString; } - protected DbConnectionPoolKey(DbConnectionPoolKey key) + private DbConnectionPoolKey(DbConnectionPoolKey key) { _connectionString = key.ConnectionString; } - public virtual object Clone() + public object Clone() { return new DbConnectionPoolKey(this); } - internal virtual string? ConnectionString + internal string? ConnectionString { get { diff --git a/src/libraries/Common/src/System/Data/ProviderBase/TimeoutTimer.cs b/src/libraries/Common/src/System/Data/ProviderBase/TimeoutTimer.cs index 6f41bf428942f..dc242f39e4afe 100644 --- a/src/libraries/Common/src/System/Data/ProviderBase/TimeoutTimer.cs +++ b/src/libraries/Common/src/System/Data/ProviderBase/TimeoutTimer.cs @@ -18,7 +18,7 @@ namespace System.Data.ProviderBase // Get remaining time in appropriate format to pass to subsystem timeouts // Check for timeout via IsExpired for checks in managed code. // Simply abandon to GC when done. - internal class TimeoutTimer + internal sealed class TimeoutTimer { //------------------- // Fields diff --git a/src/libraries/Common/src/System/Net/CaseInsensitiveAscii.cs b/src/libraries/Common/src/System/Net/CaseInsensitiveAscii.cs index 769b6c6738254..2b0cb7f207dca 100644 --- a/src/libraries/Common/src/System/Net/CaseInsensitiveAscii.cs +++ b/src/libraries/Common/src/System/Net/CaseInsensitiveAscii.cs @@ -5,7 +5,7 @@ namespace System.Net { - internal class CaseInsensitiveAscii : IEqualityComparer, IComparer + internal sealed class CaseInsensitiveAscii : IEqualityComparer, IComparer { // ASCII char ToLower table internal static readonly CaseInsensitiveAscii StaticInstance = new CaseInsensitiveAscii(); diff --git a/src/libraries/Common/src/System/Net/ContextAwareResult.cs b/src/libraries/Common/src/System/Net/ContextAwareResult.cs index a6dd15c638df9..aa073928b3ed4 100644 --- a/src/libraries/Common/src/System/Net/ContextAwareResult.cs +++ b/src/libraries/Common/src/System/Net/ContextAwareResult.cs @@ -18,7 +18,7 @@ namespace System.Net // // For now the state is not included as part of the closure. It is too common a pattern (for example with socket receive) // to have several pending IOs differentiated by their state object. We don't want that pattern to break the cache. - internal class CallbackClosure + internal sealed class CallbackClosure { private readonly AsyncCallback? _savedCallback; private readonly ExecutionContext? _savedContext; diff --git a/src/libraries/Common/src/System/Net/Http/WinInetProxyHelper.cs b/src/libraries/Common/src/System/Net/Http/WinInetProxyHelper.cs index c7271b65546ed..1e623f7a7df0f 100644 --- a/src/libraries/Common/src/System/Net/Http/WinInetProxyHelper.cs +++ b/src/libraries/Common/src/System/Net/Http/WinInetProxyHelper.cs @@ -10,7 +10,7 @@ namespace System.Net.Http { // This class is only used on OS versions where WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY // is not supported (i.e. before Win8.1/Win2K12R2) in the WinHttpOpen() function. - internal class WinInetProxyHelper + internal sealed class WinInetProxyHelper { private const int RecentAutoDetectionInterval = 120_000; // 2 minutes in milliseconds. private readonly string? _autoConfigUrl, _proxy, _proxyBypass; diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs index cb6a76350e2db..7b496baf83ee5 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/DynamicTable.cs @@ -3,7 +3,7 @@ namespace System.Net.Http.HPack { - internal class DynamicTable + internal sealed class DynamicTable { private HeaderField[] _buffer; private int _maxSize; diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs index 8899104eb18d7..2cce40894f1d0 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecoder.cs @@ -11,7 +11,7 @@ namespace System.Net.Http.HPack { - internal class HPackDecoder + internal sealed class HPackDecoder { private enum State : byte { diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs index 605cac1c0fe4b..b0225bb6f9a14 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HPackDecodingException.cs @@ -7,7 +7,7 @@ namespace System.Net.Http.HPack { // TODO: Should this be public? [Serializable] - internal class HPackDecodingException : Exception + internal sealed class HPackDecodingException : Exception { public HPackDecodingException() { diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs index 7199e3666809f..287497b7ee115 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/HuffmanDecodingException.cs @@ -7,7 +7,7 @@ namespace System.Net.Http.HPack { // TODO: Should this be public? [Serializable] - internal class HuffmanDecodingException : Exception, ISerializable + internal sealed class HuffmanDecodingException : Exception, ISerializable { public HuffmanDecodingException() { @@ -18,7 +18,7 @@ public HuffmanDecodingException(string message) { } - protected HuffmanDecodingException(SerializationInfo info, StreamingContext context) + private HuffmanDecodingException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs index f98fdf7b241a2..6faa058ebf997 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http2/Hpack/IntegerDecoder.cs @@ -6,7 +6,7 @@ namespace System.Net.Http.HPack { - internal class IntegerDecoder + internal sealed class IntegerDecoder { private int _i; private int _m; diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs index fdb03562cc8a9..96de7c6533809 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackDecoder.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.QPack { - internal class QPackDecoder : IDisposable + internal sealed class QPackDecoder : IDisposable { private enum State { diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs index 97b85b41a5273..1b09f8e9ca397 100644 --- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs +++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Http3/QPack/QPackEncoder.cs @@ -9,7 +9,7 @@ namespace System.Net.Http.QPack { - internal class QPackEncoder + internal sealed class QPackEncoder { private IEnumerator>? _enumerator; diff --git a/src/libraries/Common/src/System/Net/Mail/MailAddress.cs b/src/libraries/Common/src/System/Net/Mail/MailAddress.cs index 3a18c009a2f95..8232cbc358345 100644 --- a/src/libraries/Common/src/System/Net/Mail/MailAddress.cs +++ b/src/libraries/Common/src/System/Net/Mail/MailAddress.cs @@ -5,7 +5,7 @@ namespace System.Net.Mail { - internal class MailAddress + internal sealed class MailAddress { public MailAddress(string address) { diff --git a/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs b/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs index fa4d96807ada4..b98f271183145 100644 --- a/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs +++ b/src/libraries/Common/src/System/Net/NTAuthentication.Common.cs @@ -9,7 +9,7 @@ namespace System.Net { - internal partial class NTAuthentication + internal sealed partial class NTAuthentication { private bool _isServer; diff --git a/src/libraries/Common/src/System/Net/TlsStream.cs b/src/libraries/Common/src/System/Net/TlsStream.cs index d1557b97ff1be..0d2319916c4f1 100644 --- a/src/libraries/Common/src/System/Net/TlsStream.cs +++ b/src/libraries/Common/src/System/Net/TlsStream.cs @@ -8,7 +8,7 @@ namespace System.Net { - internal class TlsStream : NetworkStream + internal sealed class TlsStream : NetworkStream { private readonly SslStream _sslStream; private readonly string _host; diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs index 678359974789b..3747e2f331b4b 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -11,7 +11,7 @@ namespace System.Runtime.InteropServices /// managed delegates to COM's connection point based events. /// [SupportedOSPlatform("windows")] - internal partial class ComEventsSink : IDispatch, ICustomQueryInterface + internal sealed partial class ComEventsSink : IDispatch, ICustomQueryInterface { private Guid _iidSourceItf; private ComTypes.IConnectionPoint? _connectionPoint; diff --git a/src/libraries/Common/src/System/SR.cs b/src/libraries/Common/src/System/SR.cs index 20431f256a1ac..6d116dd9a4fcb 100644 --- a/src/libraries/Common/src/System/SR.cs +++ b/src/libraries/Common/src/System/SR.cs @@ -6,7 +6,7 @@ namespace System { - internal partial class SR + internal static partial class SR { #if (!NETSTANDARD1_0 && !NETSTANDARD1_1 && !NET45) // AppContext is not supported on < NetStandard1.3 or < .NET Framework 4.5 private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out bool usingResourceKeys) ? usingResourceKeys : false; diff --git a/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs b/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs index f218e5c42997e..5fd1509e7bd89 100644 --- a/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs +++ b/src/libraries/Common/src/System/Threading/Tasks/TaskCompletionSourceWithCancellation.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tasks /// s contain the relevant , /// while also avoiding unnecessary allocations for closure captures. /// - internal class TaskCompletionSourceWithCancellation : TaskCompletionSource + internal sealed class TaskCompletionSourceWithCancellation : TaskCompletionSource { public TaskCompletionSourceWithCancellation() : base(TaskCreationOptions.RunContinuationsAsynchronously) { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderEquivalence.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderEquivalence.cs index d9dabd2e838e2..ccd91a4f12d8e 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderEquivalence.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/BinderEquivalence.cs @@ -52,7 +52,7 @@ internal static T TryGetExisting(this T binder) return (T)fromCache; } - internal class BinderEqualityComparer : IEqualityComparer + internal sealed class BinderEqualityComparer : IEqualityComparer { public bool Equals(ICSharpBinder x, ICSharpBinder y) => x.IsEquivalentTo(y); public int GetHashCode(ICSharpBinder obj) => obj.GetGetBinderEquivalenceHash(); diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComBinder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComBinder.cs index 72cb677570023..e8d9ec19aedce 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComBinder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComBinder.cs @@ -282,7 +282,7 @@ private static bool TryGetMetaObjectInvoke(ref DynamicMetaObject instance) /// /// Special binder that indicates special semantics for COM GetMember operation. /// - internal class ComGetMemberBinder : GetMemberBinder + internal sealed class ComGetMemberBinder : GetMemberBinder { private readonly GetMemberBinder _originalBinder; internal bool _canReturnCallables; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComClassMetaObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComClassMetaObject.cs index 45075a2cc1758..c61fc467d991a 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComClassMetaObject.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComClassMetaObject.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ComClassMetaObject : DynamicMetaObject + internal sealed class ComClassMetaObject : DynamicMetaObject { internal ComClassMetaObject(Expression expression, ComTypeClassDesc cls) : base(expression, BindingRestrictions.Empty, cls) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventDesc.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventDesc.cs index bf728a6e7ec1f..b80397a1231fe 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventDesc.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventDesc.cs @@ -5,7 +5,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ComEventDesc + internal sealed class ComEventDesc { public Guid SourceIID; public int Dispid; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventSinksContainer.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventSinksContainer.cs index 98a4d21ce2af3..9c06e6cdf311f 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventSinksContainer.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventSinksContainer.cs @@ -12,7 +12,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop /// This list is usually attached as a custom data for RCW object and /// is finalized whenever RCW is finalized. /// - internal class ComEventSinksContainer : List, IDisposable + internal sealed class ComEventSinksContainer : List, IDisposable { private ComEventSinksContainer() { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventsSink.Extended.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventsSink.Extended.cs index 48347611f4085..c6bd8a9c459c3 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventsSink.Extended.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComEventsSink.Extended.cs @@ -7,7 +7,7 @@ namespace System.Runtime.InteropServices { - internal partial class ComEventsSink + internal sealed partial class ComEventsSink { private void Initialize(object rcw, Guid iid) { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMetaObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMetaObject.cs index 47e8f42414b23..e27839d60935b 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMetaObject.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMetaObject.cs @@ -7,7 +7,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { // Note: we only need to support the operations used by ComBinder - internal class ComMetaObject : DynamicMetaObject + internal sealed class ComMetaObject : DynamicMetaObject { internal ComMetaObject(Expression expression, BindingRestrictions restrictions, object arg) : base(expression, restrictions, arg) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMethodDesc.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMethodDesc.cs index 5b3a749a20a9d..1b47f28e30aaa 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMethodDesc.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComMethodDesc.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ComMethodDesc + internal sealed class ComMethodDesc { private readonly INVOKEKIND _invokeKind; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComTypeClassDesc.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComTypeClassDesc.cs index 1c33aff3b4358..3fa5ca8c7c754 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComTypeClassDesc.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComTypeClassDesc.cs @@ -9,7 +9,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ComTypeClassDesc : ComTypeDesc, IDynamicMetaObjectProvider + internal sealed class ComTypeClassDesc : ComTypeDesc, IDynamicMetaObjectProvider { private LinkedList _itfs; // implemented interfaces private LinkedList _sourceItfs; // source interfaces supported by this coclass diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConversionArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConversionArgBuilder.cs index dccd3ab0768e7..6958c6a0223c8 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConversionArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConversionArgBuilder.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ConversionArgBuilder : ArgBuilder + internal sealed class ConversionArgBuilder : ArgBuilder { private readonly SimpleArgBuilder _innerBuilder; private readonly Type _parameterType; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertArgBuilder.cs index 122ad62a83e72..668d269ba2ed4 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertArgBuilder.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ConvertArgBuilder : SimpleArgBuilder + internal sealed class ConvertArgBuilder : SimpleArgBuilder { private readonly Type _marshalType; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertibleArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertibleArgBuilder.cs index b9dd4b1a3c8ca..7e18343a4eaf4 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertibleArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ConvertibleArgBuilder.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ConvertibleArgBuilder : ArgBuilder + internal sealed class ConvertibleArgBuilder : ArgBuilder { internal override Expression Marshal(Expression parameter) { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispCallableMetaObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispCallableMetaObject.cs index b3a2afcf098d0..57ad83ac75f92 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispCallableMetaObject.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispCallableMetaObject.cs @@ -6,7 +6,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class DispCallableMetaObject : DynamicMetaObject + internal sealed class DispCallableMetaObject : DynamicMetaObject { private readonly DispCallable _callable; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispatchArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispatchArgBuilder.cs index 2c0c9d05af987..a44fe5799a878 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispatchArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DispatchArgBuilder.cs @@ -7,7 +7,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class DispatchArgBuilder : SimpleArgBuilder + internal sealed class DispatchArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ErrorArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ErrorArgBuilder.cs index ce82891bddc30..a82f709943957 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ErrorArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ErrorArgBuilder.cs @@ -8,7 +8,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class ErrorArgBuilder : SimpleArgBuilder + internal sealed class ErrorArgBuilder : SimpleArgBuilder { internal ErrorArgBuilder(Type parameterType) : base(parameterType) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/StringArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/StringArgBuilder.cs index be07da7422955..2eaace5023405 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/StringArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/StringArgBuilder.cs @@ -8,7 +8,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class StringArgBuilder : SimpleArgBuilder + internal sealed class StringArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeEnumMetaObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeEnumMetaObject.cs index b2b55a25b2600..2405567b372e4 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeEnumMetaObject.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeEnumMetaObject.cs @@ -8,7 +8,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class TypeEnumMetaObject : DynamicMetaObject { + internal sealed class TypeEnumMetaObject : DynamicMetaObject { private readonly ComTypeEnumDesc _desc; internal TypeEnumMetaObject(ComTypeEnumDesc desc, Expression expression) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeLibMetaObject.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeLibMetaObject.cs index ffc383536673a..b3395b4e0240f 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeLibMetaObject.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/TypeLibMetaObject.cs @@ -7,7 +7,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class TypeLibMetaObject : DynamicMetaObject { + internal sealed class TypeLibMetaObject : DynamicMetaObject { private readonly ComTypeLibDesc _lib; internal TypeLibMetaObject(Expression expression, ComTypeLibDesc lib) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/UnknownArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/UnknownArgBuilder.cs index a587e20cc391a..9c0dd4c5c7bcc 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/UnknownArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/UnknownArgBuilder.cs @@ -7,7 +7,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class UnknownArgBuilder : SimpleArgBuilder + internal sealed class UnknownArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs index 435e94f96fa73..40d36cae21e7f 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs @@ -25,7 +25,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop /// /// VarEnumSelector implements option # 3 /// - internal class VarEnumSelector + internal sealed class VarEnumSelector { private static readonly Dictionary s_comToManagedPrimitiveTypes = CreateComToManagedPrimitiveTypes(); private static readonly IList> s_comPrimitiveTypeFamilies = CreateComPrimitiveTypeFamilies(); diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArgBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArgBuilder.cs index f6cd5dc34d3c6..de0493a771c56 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArgBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArgBuilder.cs @@ -8,7 +8,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop { - internal class VariantArgBuilder : SimpleArgBuilder + internal sealed class VariantArgBuilder : SimpleArgBuilder { private readonly bool _isWrapper; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs index c09e2aa4e1c41..5d3da6f009c12 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs @@ -10,7 +10,7 @@ namespace Microsoft.CSharp.RuntimeBinder.ComInterop /// /// VariantBuilder handles packaging of arguments into a Variant for a call to IDispatch.Invoke /// - internal class VariantBuilder + internal sealed class VariantBuilder { private MemberExpression _variant; private readonly ArgBuilder _argBuilder; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs index c859eb5326ba6..5f0438a8ecc41 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/DynamicDebuggerProxy.cs @@ -51,7 +51,7 @@ public override DynamicMetaObject FallbackGetMember(DynamicMetaObject self, Dyna internal sealed class DynamicMetaObjectProviderDebugView { [System.Diagnostics.DebuggerDisplay("{value}", Name = "{name, nq}", Type = "{type, nq}")] - internal class DynamicProperty + internal sealed class DynamicProperty { [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] private readonly string name; @@ -452,13 +452,13 @@ private static IList> QueryDynamicObject(object obj } [Serializable] - internal class DynamicDebugViewEmptyException : Exception + internal sealed class DynamicDebugViewEmptyException : Exception { public DynamicDebugViewEmptyException() { } - protected DynamicDebugViewEmptyException(SerializationInfo info, StreamingContext context) + private DynamicDebugViewEmptyException(SerializationInfo info, StreamingContext context) : base(info, context) { } diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs index 15e85f43dfaeb..4d3538a495686 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookupResults.cs @@ -11,7 +11,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics // to get at the inaccessible symbols, bogus symbols, and validly bound symbols. // ---------------------------------------------------------------------------- - internal partial class CMemberLookupResults + internal sealed partial class CMemberLookupResults { private TypeArray ContainingTypes { get; }// Types that contain the member we're looking for. diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs index a27bc633f07d4..764189e817408 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs @@ -7,7 +7,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics { - internal partial class CMemberLookupResults + internal sealed partial class CMemberLookupResults { public class CMethodIterator { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AggregateSymbol.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AggregateSymbol.cs index 9d9c3b6d3037b..7076d277fbbd3 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AggregateSymbol.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/AggregateSymbol.cs @@ -14,7 +14,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics // interfaces, and structs. Parent is a namespace or class. Children are methods, // properties, and member variables, and types (including its own AGGTYPESYMs). - internal class AggregateSymbol : NamespaceOrAggregateSymbol + internal sealed class AggregateSymbol : NamespaceOrAggregateSymbol { public Type AssociatedSystemType; public Assembly AssociatedAssembly; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs index 8e9bb895a21db..9512e6e63d638 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Symbols/FieldSymbol.cs @@ -15,7 +15,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics // // ---------------------------------------------------------------------------- - internal class FieldSymbol : VariableSymbol + internal sealed class FieldSymbol : VariableSymbol { public new bool isStatic; // Static member? public bool isReadOnly; // Can only be changed from within constructor. diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryState.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryState.cs index 77aac7b8a6d9e..a3774fef395de 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryState.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryState.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Caching.Memory { - internal partial class CacheEntry + internal sealed partial class CacheEntry { // this type exists just to reduce CacheEntry size by replacing many enum & boolean fields with one of a size of Int32 private struct CacheEntryState diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryTokens.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryTokens.cs index 94e7144bb9499..b67106dd7e0d5 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryTokens.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.CacheEntryTokens.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Caching.Memory { - internal partial class CacheEntry + internal sealed partial class CacheEntry { // this type exists just to reduce average CacheEntry size // which typically is not using expiration tokens or callbacks diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.cs index 5a88f8a8a8cda..cd3aabcf840a3 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/CacheEntry.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.Caching.Memory { - internal partial class CacheEntry : ICacheEntry + internal sealed partial class CacheEntry : ICacheEntry { private static readonly Action ExpirationCallback = ExpirationTokensExpired; diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElement.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElement.cs index 26441a447436c..dde4dd82f32e3 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElement.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElement.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Configuration.Xml { - internal class XmlConfigurationElement + internal sealed class XmlConfigurationElement { public string ElementName { get; } diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementAttributeValue.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementAttributeValue.cs index bdea5cd8e60f5..a07231787a9ba 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementAttributeValue.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementAttributeValue.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Configuration.Xml { - internal class XmlConfigurationElementAttributeValue + internal sealed class XmlConfigurationElementAttributeValue { public XmlConfigurationElementAttributeValue(string attribute, string value, int? lineNumber, int? linePosition) { diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementTextContent.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementTextContent.cs index 76dab1529ddda..c3ef8fee108c0 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementTextContent.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlConfigurationElementTextContent.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Configuration.Xml { - internal class XmlConfigurationElementTextContent + internal sealed class XmlConfigurationElementTextContent { public XmlConfigurationElementTextContent(string textContent, int? linePosition, int? lineNumber) { diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlStreamConfigurationProvider.cs b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlStreamConfigurationProvider.cs index bfcd4adae3894..920a9968f4176 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlStreamConfigurationProvider.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlStreamConfigurationProvider.cs @@ -407,7 +407,7 @@ void AddToConfiguration(string key, string value, int? lineNumber, int? linePosi /// /// Helper class to build the configuration keys in a way that does not require string.Join /// - internal class Prefix + internal sealed class Prefix { private readonly StringBuilder _sb; private readonly Stack _lengths; diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/CallSiteJsonFormatter.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/CallSiteJsonFormatter.cs index bf39993860f14..a853a9fe5b590 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/CallSiteJsonFormatter.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/CallSiteJsonFormatter.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.DependencyInjection { - internal class CallSiteJsonFormatter: CallSiteVisitor + internal sealed class CallSiteJsonFormatter: CallSiteVisitor { internal static CallSiteJsonFormatter Instance = new CallSiteJsonFormatter(); diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteChain.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteChain.cs index 04ef765574116..80182dab6cce9 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteChain.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteChain.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class CallSiteChain + internal sealed class CallSiteChain { private readonly Dictionary _callSiteChain; diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs index d7e6fb0e720ad..2e8e9a889bb34 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteFactory.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class CallSiteFactory + internal sealed class CallSiteFactory { private const int DefaultSlot = 0; private readonly ServiceDescriptor[] _descriptors; diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteValidator.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteValidator.cs index 243cf1c638c72..f836ba78b41b3 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteValidator.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/CallSiteValidator.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class CallSiteValidator: CallSiteVisitor + internal sealed class CallSiteValidator: CallSiteVisitor { // Keys are services being resolved via GetService, values - first scoped service in their call site tree private readonly ConcurrentDictionary _scopedServices = new ConcurrentDictionary(); diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstantCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstantCallSite.cs index bd09485c617f6..206d2691a878f 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstantCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstantCallSite.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ConstantCallSite : ServiceCallSite + internal sealed class ConstantCallSite : ServiceCallSite { private readonly Type _serviceType; internal object DefaultValue { get; } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstructorCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstructorCallSite.cs index d25bec5bdd8eb..b44608c0841b5 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstructorCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ConstructorCallSite.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ConstructorCallSite : ServiceCallSite + internal sealed class ConstructorCallSite : ServiceCallSite { internal ConstructorInfo ConstructorInfo { get; } internal ServiceCallSite[] ParameterCallSites { get; } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/DynamicServiceProviderEngine.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/DynamicServiceProviderEngine.cs index fbc40fe43b590..20c2faf44709b 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/DynamicServiceProviderEngine.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/DynamicServiceProviderEngine.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class DynamicServiceProviderEngine : CompiledServiceProviderEngine + internal sealed class DynamicServiceProviderEngine : CompiledServiceProviderEngine { public DynamicServiceProviderEngine(IEnumerable serviceDescriptors) : base(serviceDescriptors) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs index 3b6d079590074..cfc9f9f21e63f 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionResolverBuilder.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ExpressionResolverBuilder : CallSiteVisitor + internal sealed class ExpressionResolverBuilder : CallSiteVisitor { internal static readonly MethodInfo InvokeFactoryMethodInfo = GetMethodInfo, IServiceProvider>>((a, b) => a.Invoke(b)); internal static readonly MethodInfo CaptureDisposableMethodInfo = GetMethodInfo>((a, b) => a.CaptureDisposable(b)); diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionsServiceProviderEngine.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionsServiceProviderEngine.cs index 7a81fa7f59b3e..eb6ea1e4ecb61 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionsServiceProviderEngine.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/Expressions/ExpressionsServiceProviderEngine.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ExpressionsServiceProviderEngine : ServiceProviderEngine + internal sealed class ExpressionsServiceProviderEngine : ServiceProviderEngine { private readonly ExpressionResolverBuilder _expressionResolverBuilder; public ExpressionsServiceProviderEngine(IEnumerable serviceDescriptors) : base(serviceDescriptors) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/FactoryCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/FactoryCallSite.cs index cd88c4b405f89..59e5267974ac5 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/FactoryCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/FactoryCallSite.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class FactoryCallSite : ServiceCallSite + internal sealed class FactoryCallSite : ServiceCallSite { public Func Factory { get; } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/IEnumerableCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/IEnumerableCallSite.cs index 89be681080565..7e9b0f7f89954 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/IEnumerableCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/IEnumerableCallSite.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class IEnumerableCallSite : ServiceCallSite + internal sealed class IEnumerableCallSite : ServiceCallSite { internal Type ItemType { get; } internal ServiceCallSite[] ServiceCallSites { get; } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitResolverBuilderContext.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitResolverBuilderContext.cs index def3457fe82b7..33cde16bb0091 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitResolverBuilderContext.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitResolverBuilderContext.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ILEmitResolverBuilderContext + internal sealed class ILEmitResolverBuilderContext { public ILGenerator Generator { get; set; } public List Constants { get; set; } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitServiceProviderEngine.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitServiceProviderEngine.cs index da854208dfdf9..ca8a1ad1a124e 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitServiceProviderEngine.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ILEmit/ILEmitServiceProviderEngine.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ILEmitServiceProviderEngine : ServiceProviderEngine + internal sealed class ILEmitServiceProviderEngine : ServiceProviderEngine { private readonly ILEmitResolverBuilder _expressionResolverBuilder; public ILEmitServiceProviderEngine(IEnumerable serviceDescriptors) : base(serviceDescriptors) diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/RuntimeServiceProviderEngine.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/RuntimeServiceProviderEngine.cs index 83d762739ca58..45a41c97fba74 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/RuntimeServiceProviderEngine.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/RuntimeServiceProviderEngine.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class RuntimeServiceProviderEngine : ServiceProviderEngine + internal sealed class RuntimeServiceProviderEngine : ServiceProviderEngine { public RuntimeServiceProviderEngine(IEnumerable serviceDescriptors) : base(serviceDescriptors) { diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderCallSite.cs index 8339c64ecc310..3db2f7f0723e0 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderCallSite.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ServiceProviderCallSite : ServiceCallSite + internal sealed class ServiceProviderCallSite : ServiceCallSite { public ServiceProviderCallSite() : base(ResultCache.None) { diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderEngineScope.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderEngineScope.cs index 76988982c8754..52bac8dd8038c 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderEngineScope.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceProviderEngineScope.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ServiceProviderEngineScope : IServiceScope, IServiceProvider, IAsyncDisposable + internal sealed class ServiceProviderEngineScope : IServiceScope, IServiceProvider, IAsyncDisposable { // For testing only internal Action _captureDisposableCallback; diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceScopeFactoryCallSite.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceScopeFactoryCallSite.cs index ffa0bc869213b..fc95d601f5e9f 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceScopeFactoryCallSite.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceLookup/ServiceScopeFactoryCallSite.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup { - internal class ServiceScopeFactoryCallSite : ServiceCallSite + internal sealed class ServiceScopeFactoryCallSite : ServiceCallSite { public ServiceScopeFactoryCallSite() : base(ResultCache.None) { diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs index 0f77f3f4b7b39..6c1eaff38b9e2 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DependencyContextPaths.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.DependencyModel { - internal class DependencyContextPaths + internal sealed class DependencyContextPaths { private const string DepsFilesProperty = "APP_CONTEXT_DEPS_FILES"; private const string FxDepsFileProperty = "FX_DEPS_FILE"; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs index 02dc754d96151..7fefd9483cdd4 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/DirectoryWrapper.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.DependencyModel { - internal class DirectoryWrapper: IDirectory + internal sealed class DirectoryWrapper: IDirectory { public bool Exists(string path) { diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs index 0325f9ad7eab2..a26698e0aaef3 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/EnvironmentWrapper.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyModel { - internal class EnvironmentWrapper : IEnvironment + internal sealed class EnvironmentWrapper : IEnvironment { public static IEnvironment Default = new EnvironmentWrapper(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs index a715780fa45a2..5deda61761df9 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileSystemWrapper.cs @@ -3,7 +3,7 @@ namespace Microsoft.Extensions.DependencyModel { - internal class FileSystemWrapper : IFileSystem + internal sealed class FileSystemWrapper : IFileSystem { public static IFileSystem Default { get; } = new FileSystemWrapper(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs index 34b903de77349..ef1bf5b2bc532 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/FileWrapper.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyModel { - internal class FileWrapper: IFile + internal sealed class FileWrapper: IFile { public bool Exists(string path) { diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/Clock.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/Clock.cs index 67371f56e74e7..aa154395f8b87 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/Clock.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Internal/Clock.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.FileProviders.Physical { - internal class Clock : IClock + internal sealed class Clock : IClock { public static readonly Clock Instance = new Clock(); diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Internal/InMemoryFileInfo.cs b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Internal/InMemoryFileInfo.cs index c5b40ecf76a82..90f3f83bb77d7 100644 --- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Internal/InMemoryFileInfo.cs +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Internal/InMemoryFileInfo.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.FileSystemGlobbing.Internal { - internal class InMemoryFileInfo : FileInfoBase + internal sealed class InMemoryFileInfo : FileInfoBase { private InMemoryDirectoryInfo _parent; diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs index 440444ef5073f..03df5ba943627 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/src/HostFactoryResolver.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Hosting { - internal class HostFactoryResolver + internal sealed class HostFactoryResolver { private const BindingFlags DeclaredOnlyLookup = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConfigureContainerAdapter.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConfigureContainerAdapter.cs index ae974a0538f31..13f7fc3f112b5 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConfigureContainerAdapter.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConfigureContainerAdapter.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Hosting.Internal { - internal class ConfigureContainerAdapter : IConfigureContainerAdapter + internal sealed class ConfigureContainerAdapter : IConfigureContainerAdapter { private Action _action; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs index 04b1c1b003525..fd5fe83ecafff 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Hosting.Internal { - internal class Host : IHost, IAsyncDisposable + internal sealed class Host : IHost, IAsyncDisposable { private readonly ILogger _logger; private readonly IHostLifetime _hostLifetime; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ServiceFactoryAdapter.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ServiceFactoryAdapter.cs index 130f5e4b2dc0a..fc738ef0bb5e9 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ServiceFactoryAdapter.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ServiceFactoryAdapter.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Hosting.Internal { - internal class ServiceFactoryAdapter : IServiceFactoryAdapter + internal sealed class ServiceFactoryAdapter : IServiceFactoryAdapter { private IServiceProviderFactory _serviceProviderFactory; private readonly Func _contextResolver; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/ValidationHostedService.cs b/src/libraries/Microsoft.Extensions.Hosting/src/ValidationHostedService.cs index f6b2b31955440..2bfc901a918cf 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/ValidationHostedService.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/ValidationHostedService.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.DependencyInjection { - internal class ValidationHostedService : IHostedService + internal sealed class ValidationHostedService : IHostedService { private readonly IDictionary _validators; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/ValidatorOptions.cs b/src/libraries/Microsoft.Extensions.Hosting/src/ValidatorOptions.cs index 9701860396de4..c71d1ea5f0af8 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/ValidatorOptions.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/ValidatorOptions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.DependencyInjection { - internal class ValidatorOptions + internal sealed class ValidatorOptions { // Maps each options type to a method that forces its evaluation, e.g. IOptionsMonitor.Get(name) public IDictionary Validators { get; } = new Dictionary(); diff --git a/src/libraries/Microsoft.Extensions.Http/src/ActiveHandlerTrackingEntry.cs b/src/libraries/Microsoft.Extensions.Http/src/ActiveHandlerTrackingEntry.cs index c99ee1f2250cd..c5f57d03453e7 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/ActiveHandlerTrackingEntry.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/ActiveHandlerTrackingEntry.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.Http { // Thread-safety: We treat this class as immutable except for the timer. Creating a new object // for the 'expiry' pool simplifies the threading requirements significantly. - internal class ActiveHandlerTrackingEntry + internal sealed class ActiveHandlerTrackingEntry { private static readonly TimerCallback _timerCallback = (s) => ((ActiveHandlerTrackingEntry)s).Timer_Tick(); private readonly object _lock; diff --git a/src/libraries/Microsoft.Extensions.Http/src/DefaultHttpMessageHandlerBuilder.cs b/src/libraries/Microsoft.Extensions.Http/src/DefaultHttpMessageHandlerBuilder.cs index c15bce2ba57b9..3b8f2324289b1 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DefaultHttpMessageHandlerBuilder.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DefaultHttpMessageHandlerBuilder.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Http { - internal class DefaultHttpMessageHandlerBuilder : HttpMessageHandlerBuilder + internal sealed class DefaultHttpMessageHandlerBuilder : HttpMessageHandlerBuilder { public DefaultHttpMessageHandlerBuilder(IServiceProvider services) { diff --git a/src/libraries/Microsoft.Extensions.Http/src/DefaultTypedHttpClientFactory.cs b/src/libraries/Microsoft.Extensions.Http/src/DefaultTypedHttpClientFactory.cs index 1b0f442d6091b..02215b040042f 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DefaultTypedHttpClientFactory.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DefaultTypedHttpClientFactory.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Http { - internal class DefaultTypedHttpClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient> : + internal sealed class DefaultTypedHttpClientFactory<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient> : ITypedHttpClientFactory { private readonly Cache _cache; diff --git a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/DefaultHttpClientBuilder.cs b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/DefaultHttpClientBuilder.cs index 9fb05bf99b400..8e1e3daf9096b 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/DefaultHttpClientBuilder.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/DefaultHttpClientBuilder.cs @@ -3,7 +3,7 @@ namespace Microsoft.Extensions.DependencyInjection { - internal class DefaultHttpClientBuilder : IHttpClientBuilder + internal sealed class DefaultHttpClientBuilder : IHttpClientBuilder { public DefaultHttpClientBuilder(IServiceCollection services, string name) { diff --git a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientMappingRegistry.cs b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientMappingRegistry.cs index 3737fd996eb8a..663b821a9cb5a 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientMappingRegistry.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/DependencyInjection/HttpClientMappingRegistry.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.DependencyInjection // // See: https://github.com/dotnet/extensions/issues/519 // See: https://github.com/dotnet/extensions/issues/960 - internal class HttpClientMappingRegistry + internal sealed class HttpClientMappingRegistry { public Dictionary NamedClientRegistrations { get; } = new Dictionary(); } diff --git a/src/libraries/Microsoft.Extensions.Http/src/ExpiredHandlerTrackingEntry.cs b/src/libraries/Microsoft.Extensions.Http/src/ExpiredHandlerTrackingEntry.cs index 65537b0f96b74..b5c53f810a26c 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/ExpiredHandlerTrackingEntry.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/ExpiredHandlerTrackingEntry.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Http { // Thread-safety: This class is immutable - internal class ExpiredHandlerTrackingEntry + internal sealed class ExpiredHandlerTrackingEntry { private readonly WeakReference _livenessTracker; diff --git a/src/libraries/Microsoft.Extensions.Http/src/LifetimeTrackingHttpMessageHandler.cs b/src/libraries/Microsoft.Extensions.Http/src/LifetimeTrackingHttpMessageHandler.cs index d591e59347b1c..d7537ca82a607 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/LifetimeTrackingHttpMessageHandler.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/LifetimeTrackingHttpMessageHandler.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Http // This a marker used to check if the underlying handler should be disposed. HttpClients // share a reference to an instance of this class, and when it goes out of scope the inner handler // is eligible to be disposed. - internal class LifetimeTrackingHttpMessageHandler : DelegatingHandler + internal sealed class LifetimeTrackingHttpMessageHandler : DelegatingHandler { public LifetimeTrackingHttpMessageHandler(HttpMessageHandler innerHandler) : base(innerHandler) diff --git a/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs b/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs index 54f917943e37c..dc92d3f659dfa 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/Logging/HttpHeadersLogValue.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Http.Logging { - internal class HttpHeadersLogValue : IReadOnlyList> + internal sealed class HttpHeadersLogValue : IReadOnlyList> { private readonly Kind _kind; private readonly Func _shouldRedactHeaderValue; diff --git a/src/libraries/Microsoft.Extensions.Http/src/Logging/LoggingHttpMessageHandlerBuilderFilter.cs b/src/libraries/Microsoft.Extensions.Http/src/Logging/LoggingHttpMessageHandlerBuilderFilter.cs index 1fcbd29f128b7..ebefa2047bb47 100644 --- a/src/libraries/Microsoft.Extensions.Http/src/Logging/LoggingHttpMessageHandlerBuilderFilter.cs +++ b/src/libraries/Microsoft.Extensions.Http/src/Logging/LoggingHttpMessageHandlerBuilderFilter.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Http { // Internal so we can change the requirements without breaking changes. - internal class LoggingHttpMessageHandlerBuilderFilter : IHttpMessageHandlerBuilderFilter + internal sealed class LoggingHttpMessageHandlerBuilderFilter : IHttpMessageHandlerBuilderFilter { private readonly ILoggerFactory _loggerFactory; private readonly IOptionsMonitor _optionsMonitor; diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs index af09dfbd54425..0ea20baa236d3 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Logging /// /// Formatter to convert the named format items like {NamedformatItem} to format. /// - internal class LogValuesFormatter + internal sealed class LogValuesFormatter { private const string NullValue = "(null)"; private static readonly char[] FormatDelimiters = {',', ':'}; diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerFilterConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerFilterConfigureOptions.cs index e706da9a2d0dc..bc7c220080d9d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerFilterConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerFilterConfigureOptions.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging { - internal class LoggerFilterConfigureOptions : IConfigureOptions + internal sealed class LoggerFilterConfigureOptions : IConfigureOptions { private const string LogLevelKey = "LogLevel"; private const string DefaultCategory = "Default"; diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfiguration.cs b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfiguration.cs index e4ffdb82d5c7a..7acf6596011b1 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfiguration.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfiguration.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Logging.Configuration { - internal class LoggerProviderConfiguration : ILoggerProviderConfiguration + internal sealed class LoggerProviderConfiguration : ILoggerProviderConfiguration { public LoggerProviderConfiguration(ILoggerProviderConfigurationFactory providerConfigurationFactory) { diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigurationFactory.cs b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigurationFactory.cs index 25a1c9fc1baa8..258b3a403d22c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigurationFactory.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigurationFactory.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging.Configuration { - internal class LoggerProviderConfigurationFactory : ILoggerProviderConfigurationFactory + internal sealed class LoggerProviderConfigurationFactory : ILoggerProviderConfigurationFactory { private readonly IEnumerable _configurations; diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigureOptions.cs index bb6e00d25e75e..1510cc53770e0 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggerProviderConfigureOptions.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging.Configuration /// /// Loads settings for into type. /// - internal class LoggerProviderConfigureOptions : ConfigureFromConfigurationOptions where TOptions : class + internal sealed class LoggerProviderConfigureOptions : ConfigureFromConfigurationOptions where TOptions : class { public LoggerProviderConfigureOptions(ILoggerProviderConfiguration providerConfiguration) : base(providerConfiguration.Configuration) diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggingConfiguration.cs b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggingConfiguration.cs index d4e66315af9f9..75b518d96f345 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggingConfiguration.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/LoggingConfiguration.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Logging.Configuration { - internal class LoggingConfiguration + internal sealed class LoggingConfiguration { public IConfiguration Configuration { get; } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs index 9943da694c284..6e2a8c7143ddd 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging.Console /// /// For consoles which understand the ANSI escape code sequences to represent color /// - internal class AnsiLogConsole : IConsole + internal sealed class AnsiLogConsole : IConsole { private readonly TextWriter _textWriter; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs index bf2ee5f99c901..cf6c22f67f37a 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging.Console { - internal class AnsiParser + internal sealed class AnsiParser { private readonly Action _onParseWrite; public AnsiParser(Action onParseWrite) diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs index 2b540ec86cee3..25c3218a0895d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging.Console { [UnsupportedOSPlatform("browser")] - internal class AnsiParsingLogConsole : IConsole + internal sealed class AnsiParsingLogConsole : IConsole { private readonly TextWriter _textWriter; private readonly AnsiParser _parser; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs index daa903da318b0..906f703a8d679 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.Console { [UnsupportedOSPlatform("browser")] - internal class ConsoleLogger : ILogger + internal sealed class ConsoleLogger : ILogger { private readonly string _name; private readonly ConsoleLoggerProcessor _queueProcessor; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs index 9d12ac5e111f4..372933b97e3d0 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs @@ -157,7 +157,7 @@ private static ILoggingBuilder AddFormatterWithName(this ILoggingBuilder builder } [UnsupportedOSPlatform("browser")] - internal class ConsoleLoggerFormatterConfigureOptions : ConfigureFromConfigurationOptions + internal sealed class ConsoleLoggerFormatterConfigureOptions : ConfigureFromConfigurationOptions where TOptions : ConsoleFormatterOptions where TFormatter : ConsoleFormatter { @@ -168,7 +168,7 @@ public ConsoleLoggerFormatterConfigureOptions(ILoggerProviderConfiguration : ConfigurationChangeTokenSource + internal sealed class ConsoleLoggerFormatterOptionsChangeTokenSource : ConfigurationChangeTokenSource where TOptions : ConsoleFormatterOptions where TFormatter : ConsoleFormatter { diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs index 00adb44b4b61f..16f1d5572893c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging.Console { - internal class FormatterOptionsMonitor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TOptions> : + internal sealed class FormatterOptionsMonitor<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] TOptions> : IOptionsMonitor where TOptions : ConsoleFormatterOptions { diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs index 0f363860cc9a7..b92de57e31064 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Logging.Console { - internal class JsonConsoleFormatter : ConsoleFormatter, IDisposable + internal sealed class JsonConsoleFormatter : ConsoleFormatter, IDisposable { private IDisposable _optionsReloadToken; diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs index 1c790a45e730d..73a7514278f0d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging.Console { - internal class SimpleConsoleFormatter : ConsoleFormatter, IDisposable + internal sealed class SimpleConsoleFormatter : ConsoleFormatter, IDisposable { private const string LoglevelPadding = ": "; private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs index 1916dd2fa0498..7a3e6dabb925c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.Console { - internal class SystemdConsoleFormatter : ConsoleFormatter, IDisposable + internal sealed class SystemdConsoleFormatter : ConsoleFormatter, IDisposable { private IDisposable _optionsReloadToken; diff --git a/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.cs b/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.cs index 9f7c2a5b941cf..4190843501dd2 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.Debug /// /// A logger that writes messages in the debug output window only when a debugger is attached. /// - internal partial class DebugLogger : ILogger + internal sealed partial class DebugLogger : ILogger { private readonly string _name; diff --git a/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.debug.cs b/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.debug.cs index 928bfe3ba00b1..860a2f8ccf3da 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.debug.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Debug/src/DebugLogger.debug.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Logging.Debug { - internal partial class DebugLogger + internal sealed partial class DebugLogger { private void DebugWriteLine(string message, string name) { diff --git a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs index cd83dff8aae91..6460fb61f0a79 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs @@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Logging.EventLog /// /// A logger that writes messages to Windows Event Log. /// - internal class EventLogLogger : ILogger + internal sealed class EventLogLogger : ILogger { private readonly string _name; private readonly EventLogSettings _settings; diff --git a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/WindowsEventLog.cs b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/WindowsEventLog.cs index b148714f55289..d2b8c924470e2 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/WindowsEventLog.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/WindowsEventLog.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.EventLog { [SupportedOSPlatform("windows")] - internal class WindowsEventLog : IEventLog + internal sealed class WindowsEventLog : IEventLog { // https://msdn.microsoft.com/EN-US/library/windows/desktop/aa363679.aspx private const int MaximumMessageSize = 31839; diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptions.cs index ab5c6468c684c..b38fb89f78984 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptions.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Logging { - internal class EventLogFiltersConfigureOptions : IConfigureOptions + internal sealed class EventLogFiltersConfigureOptions : IConfigureOptions { private readonly LoggingEventSource _eventSource; diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptionsChangeSource.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptionsChangeSource.cs index f5a6673f89683..687c3b5a73b60 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptionsChangeSource.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventLogFiltersConfigureOptionsChangeSource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging { - internal class EventLogFiltersConfigureOptionsChangeSource: IOptionsChangeTokenSource + internal sealed class EventLogFiltersConfigureOptionsChangeSource: IOptionsChangeTokenSource { private readonly LoggingEventSource _eventSource; diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs index 71e59250cab41..75f4481c453b4 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs @@ -20,7 +20,7 @@ namespace Microsoft.Extensions.Logging.EventSource /// On Windows platforms EventSource will deliver messages using Event Tracing for Windows (ETW) events. /// On Linux EventSource will use LTTng (http://lttng.org) to deliver messages. /// - internal class EventSourceLogger : ILogger + internal sealed class EventSourceLogger : ILogger { private static int _activityIds; private readonly LoggingEventSource _eventSource; diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/ExceptionInfo.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/ExceptionInfo.cs index 8f8b06b4aa375..8628f6c1958c2 100644 --- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/ExceptionInfo.cs +++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/ExceptionInfo.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.EventSource /// Represents information about exceptions that is captured by EventSourceLogger /// [System.Diagnostics.Tracing.EventData(Name ="ExceptionInfo")] - internal class ExceptionInfo + internal sealed class ExceptionInfo { public static ExceptionInfo Empty { get; } = new ExceptionInfo(); diff --git a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceLogger.cs b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceLogger.cs index e3e81d42cf976..8bda3a5080f54 100644 --- a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceLogger.cs +++ b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceLogger.cs @@ -7,7 +7,7 @@ namespace Microsoft.Extensions.Logging.TraceSource { - internal class TraceSourceLogger : ILogger + internal sealed class TraceSourceLogger : ILogger { private readonly DiagnosticsTraceSource _traceSource; diff --git a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceScope.cs b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceScope.cs index 229c84c3d72ed..80ecc8844e821 100644 --- a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceScope.cs +++ b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceScope.cs @@ -9,7 +9,7 @@ namespace Microsoft.Extensions.Logging.TraceSource /// /// Provides an IDisposable that represents a logical operation scope based on System.Diagnostics LogicalOperationStack /// - internal class TraceSourceScope : IDisposable + internal sealed class TraceSourceScope : IDisposable { // To detect redundant calls private bool _isDisposed; diff --git a/src/libraries/Microsoft.Extensions.Logging/src/DefaultLoggerLevelConfigureOptions.cs b/src/libraries/Microsoft.Extensions.Logging/src/DefaultLoggerLevelConfigureOptions.cs index 16c69be547b50..a6872f800826e 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/DefaultLoggerLevelConfigureOptions.cs +++ b/src/libraries/Microsoft.Extensions.Logging/src/DefaultLoggerLevelConfigureOptions.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Logging { - internal class DefaultLoggerLevelConfigureOptions : ConfigureOptions + internal sealed class DefaultLoggerLevelConfigureOptions : ConfigureOptions { public DefaultLoggerLevelConfigureOptions(LogLevel level) : base(options => options.MinLevel = level) { diff --git a/src/libraries/Microsoft.Extensions.Logging/src/Logger.cs b/src/libraries/Microsoft.Extensions.Logging/src/Logger.cs index b6462af66bbf7..58352b878b748 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/Logger.cs +++ b/src/libraries/Microsoft.Extensions.Logging/src/Logger.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Logging { - internal class Logger : ILogger + internal sealed class Logger : ILogger { public LoggerInformation[] Loggers { get; set; } public MessageLogger[] MessageLoggers { get; set; } diff --git a/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs b/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs index 24fb80efb04ec..f48efac13f5fd 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs +++ b/src/libraries/Microsoft.Extensions.Logging/src/LoggerFactoryScopeProvider.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Logging /// /// Default implementation of /// - internal class LoggerFactoryScopeProvider : IExternalScopeProvider + internal sealed class LoggerFactoryScopeProvider : IExternalScopeProvider { private readonly AsyncLocal _currentScope = new AsyncLocal(); private readonly ActivityTrackingOptions _activityTrackingOption; diff --git a/src/libraries/Microsoft.Extensions.Logging/src/LoggingBuilder.cs b/src/libraries/Microsoft.Extensions.Logging/src/LoggingBuilder.cs index 3d450cfa33c75..fd992e4c3f3b9 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/LoggingBuilder.cs +++ b/src/libraries/Microsoft.Extensions.Logging/src/LoggingBuilder.cs @@ -5,7 +5,7 @@ namespace Microsoft.Extensions.Logging { - internal class LoggingBuilder : ILoggingBuilder + internal sealed class LoggingBuilder : ILoggingBuilder { public LoggingBuilder(IServiceCollection services) { diff --git a/src/libraries/Microsoft.Extensions.Logging/src/StaticFilterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging/src/StaticFilterOptionsMonitor.cs index 88ec849ce831a..5c3715dbfd54d 100644 --- a/src/libraries/Microsoft.Extensions.Logging/src/StaticFilterOptionsMonitor.cs +++ b/src/libraries/Microsoft.Extensions.Logging/src/StaticFilterOptionsMonitor.cs @@ -6,7 +6,7 @@ namespace Microsoft.Extensions.Logging { - internal class StaticFilterOptionsMonitor : IOptionsMonitor + internal sealed class StaticFilterOptionsMonitor : IOptionsMonitor { public StaticFilterOptionsMonitor(LoggerFilterOptions currentValue) { diff --git a/src/libraries/Microsoft.Extensions.Options/src/OptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Options/src/OptionsMonitor.cs index 47ec6ab1e71e5..06e5156a83604 100644 --- a/src/libraries/Microsoft.Extensions.Options/src/OptionsMonitor.cs +++ b/src/libraries/Microsoft.Extensions.Options/src/OptionsMonitor.cs @@ -99,7 +99,7 @@ public void Dispose() _registrations.Clear(); } - internal class ChangeTrackerDisposable : IDisposable + internal sealed class ChangeTrackerDisposable : IDisposable { private readonly Action _listener; private readonly OptionsMonitor _monitor; diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs index 322da79bf88ad..cef08b6c1db36 100644 --- a/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs +++ b/src/libraries/Microsoft.XmlSerializer.Generator/src/Sgen.cs @@ -14,7 +14,7 @@ namespace Microsoft.XmlSerializer.Generator { - internal class Sgen + internal sealed class Sgen { public static int Main(string[] args) { diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs index eb94a5bfd27c0..1c892450ae43b 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableDictionary_2.Builder.cs @@ -718,7 +718,7 @@ private bool Apply(MutationResult result) /// /// A simple view of the immutable collection that the debugger can show to the developer. /// - internal class ImmutableDictionaryBuilderDebuggerProxy where TKey : notnull + internal sealed class ImmutableDictionaryBuilderDebuggerProxy where TKey : notnull { /// /// The collection to be enumerated. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableEnumerableDebuggerProxy.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableEnumerableDebuggerProxy.cs index f96b5b33314c3..13ba55038c424 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableEnumerableDebuggerProxy.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableEnumerableDebuggerProxy.cs @@ -12,7 +12,7 @@ namespace System.Collections.Immutable /// /// The type of the dictionary's keys. /// The type of the dictionary's values. - internal class ImmutableDictionaryDebuggerProxy : ImmutableEnumerableDebuggerProxy> where TKey : notnull + internal sealed class ImmutableDictionaryDebuggerProxy : ImmutableEnumerableDebuggerProxy> where TKey : notnull { /// /// Initializes a new instance of the class. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs index ee6b888241d25..3395d3cc81b0e 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableList_1.Builder.cs @@ -1100,7 +1100,7 @@ object ICollection.SyncRoot /// /// A simple view of the immutable list that the debugger can show to the developer. /// - internal class ImmutableListBuilderDebuggerProxy + internal sealed class ImmutableListBuilderDebuggerProxy { /// /// The collection to be enumerated. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs index 2f8fafe67b298..911208abcac79 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.Builder.cs @@ -655,7 +655,7 @@ public ImmutableSortedDictionary ToImmutable() /// /// A simple view of the immutable collection that the debugger can show to the developer. /// - internal class ImmutableSortedDictionaryBuilderDebuggerProxy where TKey : notnull + internal sealed class ImmutableSortedDictionaryBuilderDebuggerProxy where TKey : notnull { /// /// The collection to be enumerated. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.DebuggerProxy.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.DebuggerProxy.cs index db3c4d0b12b5d..9cbd9949f2b0d 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.DebuggerProxy.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedSet_1.Builder.DebuggerProxy.cs @@ -8,7 +8,7 @@ namespace System.Collections.Immutable /// /// A simple view of the immutable collection that the debugger can show to the developer. /// - internal class ImmutableSortedSetBuilderDebuggerProxy + internal sealed class ImmutableSortedSetBuilderDebuggerProxy { /// /// The collection to be enumerated. diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SecureObjectPool.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SecureObjectPool.cs index cf3b28595225a..363d69e0199c7 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SecureObjectPool.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/SecureObjectPool.cs @@ -38,7 +38,7 @@ internal static int NewId() } } - internal class SecureObjectPool + internal sealed class SecureObjectPool where TCaller : ISecurePooledObjectUser { public void TryAdd(TCaller caller, SecurePooledObject item) @@ -79,7 +79,7 @@ internal interface ISecurePooledObjectUser int PoolUserId { get; } } - internal class SecurePooledObject + internal sealed class SecurePooledObject { private readonly T _value; private int _owner; diff --git a/src/libraries/System.Collections.NonGeneric/src/System/Collections/Queue.cs b/src/libraries/System.Collections.NonGeneric/src/System/Collections/Queue.cs index ef57f7fa9f5c7..748729d3615ab 100644 --- a/src/libraries/System.Collections.NonGeneric/src/System/Collections/Queue.cs +++ b/src/libraries/System.Collections.NonGeneric/src/System/Collections/Queue.cs @@ -486,7 +486,7 @@ public void Reset() } } - internal class QueueDebugView + internal sealed class QueueDebugView { private readonly Queue _queue; diff --git a/src/libraries/System.Collections.NonGeneric/src/System/Collections/SortedList.cs b/src/libraries/System.Collections.NonGeneric/src/System/Collections/SortedList.cs index db4631320fba6..709bf2d0c9d4c 100644 --- a/src/libraries/System.Collections.NonGeneric/src/System/Collections/SortedList.cs +++ b/src/libraries/System.Collections.NonGeneric/src/System/Collections/SortedList.cs @@ -1103,7 +1103,7 @@ public void RemoveAt(int index) } // internal debug view class for sorted list - internal class SortedListDebugView + internal sealed class SortedListDebugView { private readonly SortedList _sortedList; diff --git a/src/libraries/System.Collections.NonGeneric/src/System/Collections/Stack.cs b/src/libraries/System.Collections.NonGeneric/src/System/Collections/Stack.cs index 99ffc1d7bc816..28b88fb8860e0 100644 --- a/src/libraries/System.Collections.NonGeneric/src/System/Collections/Stack.cs +++ b/src/libraries/System.Collections.NonGeneric/src/System/Collections/Stack.cs @@ -384,7 +384,7 @@ public void Reset() } } - internal class StackDebugView + internal sealed class StackDebugView { private readonly Stack _stack; diff --git a/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs b/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs index afa8b7a1cfbde..2d04189582726 100644 --- a/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs +++ b/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs @@ -473,7 +473,7 @@ public virtual KeysCollection Keys // Simple entry class to allow substitution of values and indexed access to keys // - internal class NameObjectEntry + internal sealed class NameObjectEntry { internal NameObjectEntry(string? name, object? value) { @@ -489,7 +489,7 @@ internal NameObjectEntry(string? name, object? value) // Enumerator over keys of NameObjectCollection // - internal class NameObjectKeysEnumerator : IEnumerator + internal sealed class NameObjectKeysEnumerator : IEnumerator { private int _pos; private readonly NameObjectCollectionBase _coll; diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs index 941e40127a3f7..5c49bd6062f71 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs @@ -12,7 +12,7 @@ namespace System.ComponentModel.DataAnnotations { - internal class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor + internal sealed class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor { [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] private Type AssociatedMetadataType { get; set; } diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/LocalizableString.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/LocalizableString.cs index ff7adc8d2d1e2..31b4998e99f3c 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/LocalizableString.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/LocalizableString.cs @@ -10,7 +10,7 @@ namespace System.ComponentModel.DataAnnotations /// A helper class for providing a localizable string property. /// This class is currently compiled in both System.Web.dll and System.ComponentModel.DataAnnotations.dll. /// - internal class LocalizableString + internal sealed class LocalizableString { #region Member fields diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MetadataPropertyDescriptorWrapper.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MetadataPropertyDescriptorWrapper.cs index 95df5e1f1a82b..f771e0e340d85 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MetadataPropertyDescriptorWrapper.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/MetadataPropertyDescriptorWrapper.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.DataAnnotations { - internal class MetadataPropertyDescriptorWrapper : PropertyDescriptor + internal sealed class MetadataPropertyDescriptorWrapper : PropertyDescriptor { private readonly PropertyDescriptor _descriptor; private readonly bool _isReadOnly; diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs index 4b4819886fd16..b97ad7b7c6550 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/UIHintAttribute.cs @@ -68,7 +68,7 @@ public UIHintAttribute(string uiHint, string? presentationLayer, params object?[ public override bool Equals(object? obj) => obj is UIHintAttribute otherAttribute && _implementation.Equals(otherAttribute._implementation); - internal class UIHintImplementation + internal sealed class UIHintImplementation { private readonly object?[]? _inputControlParameters; private IDictionary? _controlParameters; diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttributeStore.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttributeStore.cs index b53562e0f4daf..2f7b02543f0b8 100644 --- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttributeStore.cs +++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttributeStore.cs @@ -18,7 +18,7 @@ namespace System.ComponentModel.DataAnnotations /// It exists both to help performance as well as to abstract away the differences between /// Reflection and TypeDescriptor. /// - internal class ValidationAttributeStore + internal sealed class ValidationAttributeStore { private readonly Dictionary _typeStoreItems = new Dictionary(); diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs b/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs index 3b3c31d2dd712..9ed87a0ff35e2 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.Registration { public class RegistrationBuilder : CustomReflectionContext { - internal class InnerRC : ReflectionContext + internal sealed class InnerRC : ReflectionContext { public override TypeInfo MapType(TypeInfo t) { return t; } public override Assembly MapAssembly(Assembly a) { return a; } diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/WeakReferenceCollection.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/WeakReferenceCollection.cs index e3992eb89afff..bd5cc2b81ade3 100644 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/WeakReferenceCollection.cs +++ b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Collections/WeakReferenceCollection.cs @@ -6,7 +6,7 @@ namespace Microsoft.Internal.Collections { - internal class WeakReferenceCollection where T : class + internal sealed class WeakReferenceCollection where T : class { private readonly List _items = new List(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs index deaedb46ed888..b37ca10ac9ed5 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedExportDefinition.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.AttributedModel { - internal class AttributedExportDefinition : ExportDefinition + internal sealed class AttributedExportDefinition : ExportDefinition { private readonly AttributedPartCreationInfo _partCreationInfo; private readonly MemberInfo _member; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs index af82945c98b6c..e59154c185a5e 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/AttributedModel/AttributedPartCreationInfo.cs @@ -13,7 +13,7 @@ namespace System.ComponentModel.Composition.AttributedModel { - internal class AttributedPartCreationInfo : IReflectionPartCreationInfo + internal sealed class AttributedPartCreationInfo : IReflectionPartCreationInfo { private readonly Type _type; private readonly bool _ignoreConstructorImports; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs index 8cefa34a587c8..5c35b8cd5160e 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionErrorDebuggerProxy.cs @@ -6,7 +6,7 @@ namespace System.ComponentModel.Composition { - internal class CompositionErrorDebuggerProxy + internal sealed class CompositionErrorDebuggerProxy { private readonly CompositionError _error; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionExceptionDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionExceptionDebuggerProxy.cs index b06aff734a302..896903c51263f 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionExceptionDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/CompositionExceptionDebuggerProxy.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition { - internal class CompositionExceptionDebuggerProxy + internal sealed class CompositionExceptionDebuggerProxy { private readonly CompositionException _exception; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs index 09470da51de2f..1f9c8004676f7 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ExportServices.DisposableLazy.cs @@ -5,7 +5,7 @@ namespace System.ComponentModel.Composition { - internal partial class ExportServices + internal static partial class ExportServices { private sealed class DisposableLazy : Lazy, IDisposable { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs index 653bdfd4b043b..6075092aa2e40 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AssemblyCatalogDebuggerProxy.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.Hosting { - internal class AssemblyCatalogDebuggerProxy + internal sealed class AssemblyCatalogDebuggerProxy { private readonly AssemblyCatalog _catalog; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs index 570521d988830..db75263f7c974 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.PartCreatorExport.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.Composition.Hosting { public partial class CatalogExportProvider { - internal class PartCreatorExport : FactoryExport + internal sealed class PartCreatorExport : FactoryExport { private readonly CatalogExportProvider _catalogExportProvider; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeFactoryExport.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeFactoryExport.cs index 62164694a1dd7..5f49441b566af 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeFactoryExport.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeFactoryExport.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.Hosting { public partial class CatalogExportProvider { - internal class ScopeFactoryExport : FactoryExport + internal sealed class ScopeFactoryExport : FactoryExport { private readonly ScopeManager _scopeManager; private readonly CompositionScopeDefinition _catalog; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeManager.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeManager.cs index 6c421fcb5a35d..c10f2e48d045a 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeManager.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CatalogExportProvider.ScopeManager.cs @@ -8,7 +8,7 @@ namespace System.ComponentModel.Composition.Hosting { public partial class CatalogExportProvider { - internal class ScopeManager : ExportProvider + internal sealed class ScopeManager : ExportProvider { private readonly CompositionScopeDefinition _scopeDefinition; private readonly CatalogExportProvider _catalogExportProvider; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs index f6d9da22f1841..d084df496f51b 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs @@ -17,7 +17,7 @@ namespace System.ComponentModel.Composition.Hosting /// It is threadsafe, notifications are not marshalled using a SynchronizationContext. /// It is Disposable. /// - internal class ComposablePartCatalogCollection : ICollection, INotifyComposablePartCatalogChanged, IDisposable + internal sealed class ComposablePartCatalogCollection : ICollection, INotifyComposablePartCatalogChanged, IDisposable { private readonly Lock _lock = new Lock(); private readonly Action? _onChanged; @@ -251,7 +251,7 @@ public void Dispose() GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (disposing) { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinitionDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinitionDebuggerProxy.cs index 9329315fe8332..00c5909b16dab 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinitionDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionScopeDefinitionDebuggerProxy.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.Hosting { // This proxy is needed to pretty up CompositionScopeDefinitionCatalog.Parts; IQueryable // instances are not displayed in a very friendly way in the debugger. - internal class CompositionScopeDefinitionDebuggerProxy + internal sealed class CompositionScopeDefinitionDebuggerProxy { private readonly CompositionScopeDefinition _compositionScopeDefinition; @@ -35,7 +35,7 @@ public IEnumerable PublicSurface } } - public virtual IEnumerable Children + public IEnumerable Children { get { diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs index 072072f0947ac..3f16776afd9c5 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.DirectoryCatalogDebuggerProxy.cs @@ -12,7 +12,7 @@ namespace System.ComponentModel.Composition.Hosting { public partial class DirectoryCatalog { - internal class DirectoryCatalogDebuggerProxy + internal sealed class DirectoryCatalogDebuggerProxy { private readonly DirectoryCatalog _catalog; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependenciesTraversal.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependenciesTraversal.cs index 9f3b0a41836da..4c991d6542de1 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependenciesTraversal.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependenciesTraversal.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.Hosting { public partial class FilteredCatalog { - internal class DependenciesTraversal : IComposablePartCatalogTraversal + internal sealed class DependenciesTraversal : IComposablePartCatalogTraversal { private readonly IEnumerable _parts; private readonly Func _importFilter; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependentsTraversal.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependentsTraversal.cs index bb80dafa4026b..b949ec434338b 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependentsTraversal.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/FilteredCatalog.DependentsTraversal.cs @@ -17,7 +17,7 @@ public partial class FilteredCatalog /// if the chains of dependecies are rather small. To achieve that we do a very minimal structure prep upfront - merely creating a contract-based /// index of imports - and the verify the full match of imports during the traversal. Given that most parts have a very few imports this should perform well. /// - internal class DependentsTraversal : IComposablePartCatalogTraversal + internal sealed class DependentsTraversal : IComposablePartCatalogTraversal { private readonly IEnumerable _parts; private readonly Func _importFilter; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportSourceImportDefinitionHelpers.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportSourceImportDefinitionHelpers.cs index 825da007d8520..17194f7b9bf6f 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportSourceImportDefinitionHelpers.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ImportSourceImportDefinitionHelpers.cs @@ -25,7 +25,7 @@ public static ImportDefinition RemoveImportSource(this ImportDefinition definiti } } - internal class NonImportSourceImportDefinition : ContractBasedImportDefinition + internal sealed class NonImportSourceImportDefinition : ContractBasedImportDefinition { private readonly ContractBasedImportDefinition _sourceDefinition; private IDictionary? _metadata; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportCardinalityMismatchExceptionDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportCardinalityMismatchExceptionDebuggerProxy.cs index 1c407a72bee54..bd962545c8823 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportCardinalityMismatchExceptionDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ImportCardinalityMismatchExceptionDebuggerProxy.cs @@ -5,7 +5,7 @@ namespace System.ComponentModel.Composition { - internal class ImportCardinalityMismatchExceptionDebuggerProxy + internal sealed class ImportCardinalityMismatchExceptionDebuggerProxy { private readonly ImportCardinalityMismatchException _exception; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs index 7b11ce0ee5abf..564009e41c424 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartCatalogDebuggerProxy.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.Primitives { // This proxy is needed to pretty up ComposablePartCatalog.Parts; IQueryable // instances are not displayed in a very friendly way in the debugger. - internal class ComposablePartCatalogDebuggerProxy + internal sealed class ComposablePartCatalogDebuggerProxy { private readonly ComposablePartCatalog _catalog; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartExceptionDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartExceptionDebuggerProxy.cs index c39090c7a652b..e1a7ed05dc83f 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartExceptionDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/ComposablePartExceptionDebuggerProxy.cs @@ -5,7 +5,7 @@ namespace System.ComponentModel.Composition.Primitives { - internal class ComposablePartExceptionDebuggerProxy + internal sealed class ComposablePartExceptionDebuggerProxy { private readonly ComposablePartException _exception; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElement.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElement.cs index 4a763f651c2dc..b9d01b4a7ca2e 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElement.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElement.cs @@ -8,7 +8,7 @@ namespace System.ComponentModel.Composition.Primitives // Represents the ICompositionElement placeholder for an // object that does not implement ICompositionElement [DebuggerTypeProxy(typeof(CompositionElementDebuggerProxy))] - internal class CompositionElement : ICompositionElement + internal sealed class CompositionElement : ICompositionElement { private readonly string _displayName; private readonly ICompositionElement? _origin; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs index 3f5de88c78990..2eb059a51931a 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/CompositionElementDebuggerProxy.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.Primitives // when viewing CompositionError.Element in the watch and data tips windows, we // need this proxy so that the underlying object wrapped by the CompositionElement // placeholder is displayed by default. - internal class CompositionElementDebuggerProxy + internal sealed class CompositionElementDebuggerProxy { private readonly CompositionElement _element; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs index 7e5fd59a6cbb0..cbf531b3bf638 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Primitives/SerializableCompositionElement.cs @@ -10,7 +10,7 @@ namespace System.ComponentModel.Composition.Primitives { [Serializable] - internal class SerializableCompositionElement : ICompositionElement + internal sealed class SerializableCompositionElement : ICompositionElement { private readonly string _displayName; private readonly ICompositionElement? _origin; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs index bfd87de6789b3..a0a1d9f38e914 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ExportingMember.cs @@ -8,7 +8,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ExportingMember + internal sealed class ExportingMember { private readonly ExportDefinition _definition; private readonly ReflectionMember _member; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs index 9a12670095cb0..d0e4ac2324edc 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/GenericSpecializationPartCreationInfo.cs @@ -13,7 +13,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class GenericSpecializationPartCreationInfo : IReflectionPartCreationInfo + internal sealed class GenericSpecializationPartCreationInfo : IReflectionPartCreationInfo { private readonly IReflectionPartCreationInfo _originalPartCreationInfo; private readonly ReflectionComposablePartDefinition _originalPart; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs index 18edae8dc4f46..cb4ea1ce43b35 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportType.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { // Describes the import type of a Reflection-based import definition - internal class ImportType + internal sealed class ImportType { private static readonly Type LazyOfTType = typeof(Lazy<>); private static readonly Type LazyOfTMType = typeof(Lazy<,>); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs index b4ba138c577d8..b0c424d085565 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingMember.cs @@ -12,7 +12,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ImportingMember : ImportingItem + internal sealed class ImportingMember : ImportingItem { private readonly ReflectionWritableMember _member; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs index acdf1eee3b726..0ba911ffbbea9 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ImportingParameter.cs @@ -5,7 +5,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ImportingParameter : ImportingItem + internal sealed class ImportingParameter : ImportingItem { public ImportingParameter(ContractBasedImportDefinition definition, ImportType importType) : base(definition, importType) diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs index 6896cba737dbd..244eccf3df3ed 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorExportDefinition.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class PartCreatorExportDefinition : ExportDefinition + internal sealed class PartCreatorExportDefinition : ExportDefinition { private readonly ExportDefinition _productDefinition; private IDictionary? _metadata; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs index 411975988ebef..483f6bf6f0a37 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorMemberImportDefinition.cs @@ -8,7 +8,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class PartCreatorMemberImportDefinition : ReflectionMemberImportDefinition, IPartCreatorImportDefinition + internal sealed class PartCreatorMemberImportDefinition : ReflectionMemberImportDefinition, IPartCreatorImportDefinition { private readonly ContractBasedImportDefinition _productImportDefinition; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs index 88f5352545dfb..09452db87569f 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/PartCreatorParameterImportDefinition.cs @@ -9,7 +9,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class PartCreatorParameterImportDefinition : ReflectionParameterImportDefinition, IPartCreatorImportDefinition + internal sealed class PartCreatorParameterImportDefinition : ReflectionParameterImportDefinition, IPartCreatorImportDefinition { private readonly ContractBasedImportDefinition _productImportDefinition; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs index f8e027358a245..7628378dc5f51 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePartDefinition.cs @@ -11,7 +11,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ReflectionComposablePartDefinition : ComposablePartDefinition, ICompositionElement + internal sealed class ReflectionComposablePartDefinition : ComposablePartDefinition, ICompositionElement { private readonly IReflectionPartCreationInfo _creationInfo; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs index 8a61292201386..544227712ac35 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionField.cs @@ -6,7 +6,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ReflectionField : ReflectionWritableMember + internal sealed class ReflectionField : ReflectionWritableMember { private readonly FieldInfo _field; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs index 3fd081422962a..ef9f32a8f766e 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMemberExportDefinition.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ReflectionMemberExportDefinition : ExportDefinition, ICompositionElement + internal sealed class ReflectionMemberExportDefinition : ExportDefinition, ICompositionElement { private readonly LazyMemberInfo _member; private readonly ExportDefinition _exportDefinition; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs index d27d7d4f28970..a869d34e539ce 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionMethod.cs @@ -6,7 +6,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal partial class ReflectionMethod : ReflectionMember + internal sealed partial class ReflectionMethod : ReflectionMember { private readonly MethodInfo _method; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs index c7a47b3f65fc0..9fabe855f0911 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionModelServices.cs @@ -314,7 +314,7 @@ public static bool TryMakeGenericPartDefinition(ComposablePartDefinition partDef } } - internal class ReflectionPartCreationInfo : IReflectionPartCreationInfo + internal sealed class ReflectionPartCreationInfo : IReflectionPartCreationInfo { private readonly Lazy _partType; private readonly Lazy>? _imports; @@ -463,7 +463,7 @@ public ICompositionElement? Origin } } - internal class LazyExportDefinition : ExportDefinition + internal sealed class LazyExportDefinition : ExportDefinition { private readonly Lazy> _metadata; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs index 69ef96e5dd66e..5eae39835e4d2 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionParameter.cs @@ -7,7 +7,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ReflectionParameter : ReflectionItem + internal sealed class ReflectionParameter : ReflectionItem { private readonly ParameterInfo _parameter; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs index 78e4f47873592..c47bb33f17dd0 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionProperty.cs @@ -14,7 +14,7 @@ namespace System.ComponentModel.Composition.ReflectionModel // you to go from a metadata token -> PropertyInfo like it does with types, // fields, and methods. - internal class ReflectionProperty : ReflectionWritableMember + internal sealed class ReflectionProperty : ReflectionWritableMember { private readonly MethodInfo? _getMethod; private readonly MethodInfo? _setMethod; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs index aa1c154a99299..d06d87eb2525f 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionType.cs @@ -5,7 +5,7 @@ namespace System.ComponentModel.Composition.ReflectionModel { - internal class ReflectionType : ReflectionMember + internal sealed class ReflectionType : ReflectionMember { private readonly Type _type; diff --git a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.manual.cs b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.manual.cs index 67789567ccb91..2b276c17aa383 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.manual.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.manual.cs @@ -7,6 +7,6 @@ public abstract partial class DesignerOptionService { [System.ComponentModel.TypeConverter(typeof(DesignerOptionConverter))] public sealed partial class DesignerOptionCollection { } - internal class DesignerOptionConverter { } + internal sealed class DesignerOptionConverter { } } } diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/MS/Internal/Xml/Linq/ComponentModel/XComponentModel.cs b/src/libraries/System.ComponentModel.TypeConverter/src/MS/Internal/Xml/Linq/ComponentModel/XComponentModel.cs index b171c0b34ab78..67df1e5bbacef 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/MS/Internal/Xml/Linq/ComponentModel/XComponentModel.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/MS/Internal/Xml/Linq/ComponentModel/XComponentModel.cs @@ -11,7 +11,7 @@ namespace MS.Internal.Xml.Linq.ComponentModel { - internal class XTypeDescriptionProvider : TypeDescriptionProvider + internal sealed class XTypeDescriptionProvider : TypeDescriptionProvider { public XTypeDescriptionProvider() : base(TypeDescriptor.GetProvider(typeof(T))) { @@ -23,7 +23,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor([DynamicallyAccessedMemb } } - internal class XTypeDescriptor : CustomTypeDescriptor + internal sealed class XTypeDescriptor : CustomTypeDescriptor { public XTypeDescriptor(ICustomTypeDescriptor parent) : base(parent) { @@ -141,7 +141,7 @@ protected virtual void OnChanging(object sender, XObjectChangeEventArgs args) } } - internal class XElementAttributePropertyDescriptor : XPropertyDescriptor + internal sealed class XElementAttributePropertyDescriptor : XPropertyDescriptor { private XDeferredSingleton _value; private XAttribute _changeState; @@ -193,7 +193,7 @@ protected override void OnChanging(object sender, XObjectChangeEventArgs args) } } - internal class XElementDescendantsPropertyDescriptor : XPropertyDescriptor> + internal sealed class XElementDescendantsPropertyDescriptor : XPropertyDescriptor> { private XDeferredAxis _value; private XName _changeState; @@ -246,7 +246,7 @@ protected override void OnChanging(object sender, XObjectChangeEventArgs args) } } - internal class XElementElementPropertyDescriptor : XPropertyDescriptor + internal sealed class XElementElementPropertyDescriptor : XPropertyDescriptor { private XDeferredSingleton _value; private XElement _changeState; @@ -314,7 +314,7 @@ protected override void OnChanging(object sender, XObjectChangeEventArgs args) } } - internal class XElementElementsPropertyDescriptor : XPropertyDescriptor> + internal sealed class XElementElementsPropertyDescriptor : XPropertyDescriptor> { private XDeferredAxis _value; private object _changeState; @@ -378,7 +378,7 @@ protected override void OnChanging(object sender, XObjectChangeEventArgs args) } } - internal class XElementValuePropertyDescriptor : XPropertyDescriptor + internal sealed class XElementValuePropertyDescriptor : XPropertyDescriptor { private XElement _element; @@ -430,7 +430,7 @@ protected override void OnChanged(object sender, XObjectChangeEventArgs args) } } - internal class XElementXmlPropertyDescriptor : XPropertyDescriptor + internal sealed class XElementXmlPropertyDescriptor : XPropertyDescriptor { private XElement _element; @@ -454,7 +454,7 @@ protected override void OnChanged(object sender, XObjectChangeEventArgs args) } } - internal class XAttributeValuePropertyDescriptor : XPropertyDescriptor + internal sealed class XAttributeValuePropertyDescriptor : XPropertyDescriptor { private XAttribute _attribute; @@ -494,7 +494,7 @@ protected override void OnChanged(object sender, XObjectChangeEventArgs args) } } - internal class XDeferredAxis : IEnumerable, IEnumerable where T : XObject + internal sealed class XDeferredAxis : IEnumerable, IEnumerable where T : XObject { private readonly Func> _func; internal XElement element; @@ -540,7 +540,7 @@ public IEnumerable this[string expandedName] } } - internal class XDeferredSingleton where T : XObject + internal sealed class XDeferredSingleton where T : XObject { private readonly Func _func; internal XElement element; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs index c650b38372f75..64a4498443efd 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/DesigntimeLicenseContext.cs @@ -40,7 +40,7 @@ public override void SetSavedLicenseKey(Type type, string key) } } - internal class RuntimeLicenseContext : LicenseContext + internal sealed class RuntimeLicenseContext : LicenseContext { internal Hashtable _savedLicenseKeys; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/InvariantComparer.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/InvariantComparer.cs index 2ca5f86258412..241b41bc0f604 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/InvariantComparer.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/InvariantComparer.cs @@ -6,7 +6,7 @@ namespace System { - internal class InvariantComparer : IComparer + internal sealed class InvariantComparer : IComparer { private readonly CompareInfo _compareInfo; internal static readonly InvariantComparer Default = new InvariantComparer(); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingExportDescriptor.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingExportDescriptor.cs index 8d3983a896b23..1d6670a2688b8 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingExportDescriptor.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingExportDescriptor.cs @@ -6,7 +6,7 @@ namespace System.Composition.Hosting.Core { - internal class CycleBreakingExportDescriptor : ExportDescriptor + internal sealed class CycleBreakingExportDescriptor : ExportDescriptor { private readonly Lazy _exportDescriptor; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingMetadataDictionary.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingMetadataDictionary.cs index 20776997558d9..fce39352386e6 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingMetadataDictionary.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/CycleBreakingMetadataDictionary.cs @@ -6,7 +6,7 @@ namespace System.Composition.Hosting.Core { - internal class CycleBreakingMetadataDictionary : IDictionary + internal sealed class CycleBreakingMetadataDictionary : IDictionary { private readonly Lazy _exportDescriptor; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/DirectExportDescriptor.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/DirectExportDescriptor.cs index d0d668712ddcc..f85aa1be1e153 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/DirectExportDescriptor.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/DirectExportDescriptor.cs @@ -5,7 +5,7 @@ namespace System.Composition.Hosting.Core { - internal class DirectExportDescriptor : ExportDescriptor + internal sealed class DirectExportDescriptor : ExportDescriptor { private readonly CompositeActivator _activator; private readonly IDictionary _metadata; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistry.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistry.cs index 7fb765ecbde5a..4a3cc25cdbbda 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistry.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistry.cs @@ -6,7 +6,7 @@ namespace System.Composition.Hosting.Core { - internal class ExportDescriptorRegistry + internal sealed class ExportDescriptorRegistry { private readonly object _thisLock = new object(); private readonly ExportDescriptorProvider[] _exportDescriptorProviders; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistryUpdate.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistryUpdate.cs index 43112a62232a9..2c01ff65bd108 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistryUpdate.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/ExportDescriptorRegistryUpdate.cs @@ -8,7 +8,7 @@ namespace System.Composition.Hosting.Core { - internal class ExportDescriptorRegistryUpdate : DependencyAccessor + internal sealed class ExportDescriptorRegistryUpdate : DependencyAccessor { private readonly IDictionary _partDefinitions; private readonly ExportDescriptorProvider[] _exportDescriptorProviders; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/UpdateResult.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/UpdateResult.cs index d842fdb8a0d10..0be00d63fc9eb 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/UpdateResult.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Core/UpdateResult.cs @@ -9,7 +9,7 @@ namespace System.Composition.Hosting.Core // Update results ensure that providers can query reentrantly for the contract that // they are being queried for. The UpdateResult type keeps a list of remaining // providers, with providers being removed from the list before querying. - internal class UpdateResult + internal sealed class UpdateResult { private static readonly ExportDescriptorPromise[] s_noPromises = Array.Empty(); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/CurrentScope/CurrentScopeExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/CurrentScope/CurrentScopeExportDescriptorProvider.cs index 2faf7c232be2d..4e52f5178e505 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/CurrentScope/CurrentScopeExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/CurrentScope/CurrentScopeExportDescriptorProvider.cs @@ -6,7 +6,7 @@ namespace System.Composition.Hosting.Providers.CurrentScope { - internal class CurrentScopeExportDescriptorProvider : ExportDescriptorProvider + internal sealed class CurrentScopeExportDescriptorProvider : ExportDescriptorProvider { private static readonly CompositionContract s_currentScopeContract = new CompositionContract(typeof(CompositionContext)); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryExportDescriptorProvider.cs index 0421cb463ddcc..09b980168f1d3 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryExportDescriptorProvider.cs @@ -9,7 +9,7 @@ namespace System.Composition.Hosting.Providers.ExportFactory { - internal class ExportFactoryExportDescriptorProvider : ExportDescriptorProvider + internal sealed class ExportFactoryExportDescriptorProvider : ExportDescriptorProvider { private static readonly MethodInfo s_getExportFactoryDefinitionsMethod = typeof(ExportFactoryExportDescriptorProvider).GetTypeInfo().GetDeclaredMethod("GetExportFactoryDescriptors"); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryWithMetadataExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryWithMetadataExportDescriptorProvider.cs index 6e6bb5ab3d951..0b6a07d8b410a 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryWithMetadataExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ExportFactory/ExportFactoryWithMetadataExportDescriptorProvider.cs @@ -10,7 +10,7 @@ namespace System.Composition.Hosting.Providers.ExportFactory { - internal class ExportFactoryWithMetadataExportDescriptorProvider : ExportDescriptorProvider + internal sealed class ExportFactoryWithMetadataExportDescriptorProvider : ExportDescriptorProvider { private static readonly MethodInfo s_getLazyDefinitionsMethod = typeof(ExportFactoryWithMetadataExportDescriptorProvider).GetTypeInfo().GetDeclaredMethod("GetExportFactoryDescriptors"); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ImportMany/ImportManyExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ImportMany/ImportManyExportDescriptorProvider.cs index 41c1ff4fb9cc9..254909aac7734 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ImportMany/ImportManyExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/ImportMany/ImportManyExportDescriptorProvider.cs @@ -9,7 +9,7 @@ namespace System.Composition.Hosting.Providers.ImportMany { - internal class ImportManyExportDescriptorProvider : ExportDescriptorProvider + internal sealed class ImportManyExportDescriptorProvider : ExportDescriptorProvider { private static readonly MethodInfo s_getImportManyDefinitionMethod = typeof(ImportManyExportDescriptorProvider).GetTypeInfo().GetDeclaredMethod("GetImportManyDescriptor"); private static readonly Type[] s_supportedContractTypes = new[] { typeof(IList<>), typeof(ICollection<>), typeof(IEnumerable<>) }; diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyExportDescriptorProvider.cs index fd749ab93bbc9..6bb04a2a8be5c 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyExportDescriptorProvider.cs @@ -9,7 +9,7 @@ namespace System.Composition.Hosting.Providers.Lazy { - internal class LazyExportDescriptorProvider : ExportDescriptorProvider + internal sealed class LazyExportDescriptorProvider : ExportDescriptorProvider { private static readonly MethodInfo s_getLazyDefinitionsMethod = typeof(LazyExportDescriptorProvider) .GetTypeInfo().GetDeclaredMethod("GetLazyDefinitions"); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyWithMetadataExportDescriptorProvider.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyWithMetadataExportDescriptorProvider.cs index e33e425150f21..e2460c1a84c98 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyWithMetadataExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Providers/Lazy/LazyWithMetadataExportDescriptorProvider.cs @@ -10,7 +10,7 @@ namespace System.Composition.Hosting.Providers.Lazy { - internal class LazyWithMetadataExportDescriptorProvider : ExportDescriptorProvider + internal sealed class LazyWithMetadataExportDescriptorProvider : ExportDescriptorProvider { private static readonly MethodInfo s_getLazyDefinitionsMethod = typeof(LazyWithMetadataExportDescriptorProvider).GetTypeInfo().GetDeclaredMethod("GetLazyDefinitions"); diff --git a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/SmallSparseInitonlyArray.cs b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/SmallSparseInitonlyArray.cs index d579a50643e63..bd026a95f8c82 100644 --- a/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/SmallSparseInitonlyArray.cs +++ b/src/libraries/System.Composition.Hosting/src/System/Composition/Hosting/Util/SmallSparseInitonlyArray.cs @@ -6,7 +6,7 @@ namespace System.Composition.Hosting.Util // Extremely performance-sensitive. // Always safe for reading, even under concurrent writes, // only one writer at a time allowed. - internal class SmallSparseInitonlyArray + internal sealed class SmallSparseInitonlyArray { private sealed class Element { public int Index; public object Value; } diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/ContainerConfigurationDebuggerProxy.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/ContainerConfigurationDebuggerProxy.cs index 5e91bf571c0a7..a899bbef59a63 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/ContainerConfigurationDebuggerProxy.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/ContainerConfigurationDebuggerProxy.cs @@ -12,7 +12,7 @@ namespace System.Composition.Debugging { - internal class ContainerConfigurationDebuggerProxy + internal sealed class ContainerConfigurationDebuggerProxy { private readonly ContainerConfiguration _configuration; private DiscoveredPart[] _discoveredParts; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/DiscoveredPartDebuggerProxy.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/DiscoveredPartDebuggerProxy.cs index d3cf45f301e08..9c6a51f5439e5 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/DiscoveredPartDebuggerProxy.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/Debugging/DiscoveredPartDebuggerProxy.cs @@ -8,7 +8,7 @@ namespace System.Composition.Debugging { - internal class DiscoveredPartDebuggerProxy + internal sealed class DiscoveredPartDebuggerProxy { private readonly DiscoveredPart _discoveredPart; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/DisposalFeature.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/DisposalFeature.cs index 1d5317fb473ec..a6624e45d981b 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/DisposalFeature.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/DisposalFeature.cs @@ -10,7 +10,7 @@ namespace System.Composition.TypedParts.ActivationFeatures /// /// Modifies the activator so that disposable instances are bound to the appropriate scope. /// - internal class DisposalFeature : ActivationFeature + internal sealed class DisposalFeature : ActivationFeature { public override CompositeActivator RewriteActivator( TypeInfo partType, diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/LifetimeFeature.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/LifetimeFeature.cs index 554bfc3552dd1..3735067e3be06 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/LifetimeFeature.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/LifetimeFeature.cs @@ -11,7 +11,7 @@ namespace System.Composition.TypedParts.ActivationFeatures /// Modifies the activators of parts so that they a) get associated with the correct /// scope, and b) obtain their dependencies from the correct scope. /// - internal class LifetimeFeature : ActivationFeature + internal sealed class LifetimeFeature : ActivationFeature { public const string SharingBoundaryPartMetadataName = "SharingBoundary"; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/OnImportsSatisfiedFeature.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/OnImportsSatisfiedFeature.cs index 8d06b69cdf25d..0824f2e318b0b 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/OnImportsSatisfiedFeature.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/OnImportsSatisfiedFeature.cs @@ -15,7 +15,7 @@ namespace System.Composition.TypedParts.ActivationFeatures /// Modifies activators of parts that have so that /// their [OnImportsSatisfied] method is correctly called. /// - internal class OnImportsSatisfiedFeature : ActivationFeature + internal sealed class OnImportsSatisfiedFeature : ActivationFeature { private readonly AttributedModelProvider _attributeContext; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyImportSite.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyImportSite.cs index 980e73b64ed23..29f7f2e735e5d 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyImportSite.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyImportSite.cs @@ -8,7 +8,7 @@ namespace System.Composition.TypedParts.ActivationFeatures /// /// Represents a part property that is configured as an import. /// - internal class PropertyImportSite + internal sealed class PropertyImportSite { private readonly PropertyInfo _pi; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyInjectionFeature.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyInjectionFeature.cs index 558f482b62bed..82f73a87ba5f4 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyInjectionFeature.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ActivationFeatures/PropertyInjectionFeature.cs @@ -14,7 +14,7 @@ namespace System.Composition.TypedParts.ActivationFeatures /// Modifies activators of parts with property imports so that the properties /// are set appropriately. /// - internal class PropertyInjectionFeature : ActivationFeature + internal sealed class PropertyInjectionFeature : ActivationFeature { private readonly AttributedModelProvider _attributeContext; private static readonly MethodInfo s_activatorInvokeMethod = typeof(CompositeActivator).GetTypeInfo().GetDeclaredMethod("Invoke"); diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredInstanceExport.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredInstanceExport.cs index fd21c84e1f47e..0fd6823ad614a 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredInstanceExport.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredInstanceExport.cs @@ -7,7 +7,7 @@ namespace System.Composition.TypedParts.Discovery { - internal class DiscoveredInstanceExport : DiscoveredExport + internal sealed class DiscoveredInstanceExport : DiscoveredExport { public DiscoveredInstanceExport(CompositionContract contract, IDictionary metadata) : base(contract, metadata) diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPart.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPart.cs index 97f66ef898f14..2f3f6dcc923eb 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPart.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPart.cs @@ -17,7 +17,7 @@ namespace System.Composition.TypedParts.Discovery { [DebuggerDisplay("{PartType.Name}")] [DebuggerTypeProxy(typeof(DiscoveredPartDebuggerProxy))] - internal class DiscoveredPart + internal sealed class DiscoveredPart { private readonly TypeInfo _partType; private readonly AttributedModelProvider _attributeContext; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPropertyExport.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPropertyExport.cs index 3367cc7bbe00b..098e39facd328 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPropertyExport.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/DiscoveredPropertyExport.cs @@ -8,7 +8,7 @@ namespace System.Composition.TypedParts.Discovery { - internal class DiscoveredPropertyExport : DiscoveredExport + internal sealed class DiscoveredPropertyExport : DiscoveredExport { private static readonly MethodInfo s_activatorInvoke = typeof(CompositeActivator).GetRuntimeMethod("Invoke", new[] { typeof(LifetimeContext), typeof(CompositionOperation) }); diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/ParameterImportSite.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/ParameterImportSite.cs index 01a120d93ad36..6e0a54013d2d6 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/ParameterImportSite.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/ParameterImportSite.cs @@ -5,7 +5,7 @@ namespace System.Composition.TypedParts.Discovery { - internal class ParameterImportSite + internal sealed class ParameterImportSite { private readonly ParameterInfo _pi; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/TypeInspector.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/TypeInspector.cs index aeab2667cc116..d6d63828d1f2f 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/TypeInspector.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Discovery/TypeInspector.cs @@ -11,7 +11,7 @@ namespace System.Composition.TypedParts.Discovery { - internal class TypeInspector + internal sealed class TypeInspector { private static readonly IDictionary s_noMetadata = new Dictionary(); diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ImportInfo.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ImportInfo.cs index caa7e02d21320..41ce4e1a16c97 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ImportInfo.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/ImportInfo.cs @@ -5,7 +5,7 @@ namespace System.Composition.TypedParts { - internal class ImportInfo + internal sealed class ImportInfo { private readonly CompositionContract _exportKey; private readonly bool _allowDefault; diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/TypedPartExportDescriptorProvider.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/TypedPartExportDescriptorProvider.cs index 68e4b2d687791..7c3a276c9abab 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/TypedPartExportDescriptorProvider.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/TypedPartExportDescriptorProvider.cs @@ -11,7 +11,7 @@ namespace System.Composition.TypedParts { - internal class TypedPartExportDescriptorProvider : ExportDescriptorProvider + internal sealed class TypedPartExportDescriptorProvider : ExportDescriptorProvider { private readonly IDictionary> _discoveredParts = new Dictionary>(); diff --git a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Util/DirectAttributeContext.cs b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Util/DirectAttributeContext.cs index 7e3e7670f96bb..2b54b8c1785a2 100644 --- a/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Util/DirectAttributeContext.cs +++ b/src/libraries/System.Composition.TypedParts/src/System/Composition/TypedParts/Util/DirectAttributeContext.cs @@ -7,7 +7,7 @@ namespace System.Composition.TypedParts.Util { - internal class DirectAttributeContext : AttributedModelProvider + internal sealed class DirectAttributeContext : AttributedModelProvider { public override IEnumerable GetCustomAttributes(Type reflectedType, Reflection.MemberInfo member) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs index 6c95205da167a..0f41dd3a3732b 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs @@ -10,7 +10,7 @@ namespace System.Configuration { - internal class ClientConfigPaths + internal sealed class ClientConfigPaths { internal const string UserConfigFilename = "user.config"; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigDefinitionUpdates.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigDefinitionUpdates.cs index 53039f2420a63..277ec9673bda4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigDefinitionUpdates.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigDefinitionUpdates.cs @@ -6,7 +6,7 @@ namespace System.Configuration using Collections; // Contains all the updates to section definitions across all location sections. - internal class ConfigDefinitionUpdates + internal sealed class ConfigDefinitionUpdates { internal ConfigDefinitionUpdates() { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSchemaErrors.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSchemaErrors.cs index 4ccdf5721ec73..662c2132f7e18 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSchemaErrors.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationSchemaErrors.cs @@ -5,7 +5,7 @@ namespace System.Configuration { - internal class ConfigurationSchemaErrors + internal sealed class ConfigurationSchemaErrors { // All errors related to a config file are logged to this list. // This includes all global errors, all non-specific errors, diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValue.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValue.cs index 392354f625791..ae71204a15a87 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValue.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValue.cs @@ -3,7 +3,7 @@ namespace System.Configuration { - internal class ConfigurationValue + internal sealed class ConfigurationValue { internal PropertySourceInfo SourceInfo; internal object Value; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValues.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValues.cs index b994094af0fc8..3ee1830a90adb 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValues.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationValues.cs @@ -6,7 +6,7 @@ namespace System.Configuration { - internal class ConfigurationValues : NameObjectCollectionBase + internal sealed class ConfigurationValues : NameObjectCollectionBase { private static volatile IEnumerable s_emptyCollection; private BaseConfigurationRecord _configRecord; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DateTimeConfigurationElement.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DateTimeConfigurationElement.cs index 7787c7cfb5230..348b5eacc3e42 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DateTimeConfigurationElement.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DateTimeConfigurationElement.cs @@ -3,7 +3,7 @@ namespace System.Configuration { - internal class DateTimeConfigurationElement : ConfigurationElement + internal sealed class DateTimeConfigurationElement : ConfigurationElement { private static readonly ConfigurationProperty s_propValue = new ConfigurationProperty("value", typeof(DateTime), DateTime.MinValue, ConfigurationPropertyOptions.IsKey); diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DeclarationUpdate.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DeclarationUpdate.cs index bcb95e8711c40..00bfa3b1472f5 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DeclarationUpdate.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DeclarationUpdate.cs @@ -3,7 +3,7 @@ namespace System.Configuration { - internal class DeclarationUpdate : Update + internal sealed class DeclarationUpdate : Update { internal DeclarationUpdate(string configKey, bool moved, string updatedXml) : base(configKey, moved, updatedXml) { } } diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DefinitionUpdate.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DefinitionUpdate.cs index 4e18a36adadb2..f74b0f23bb0d4 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DefinitionUpdate.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/DefinitionUpdate.cs @@ -3,7 +3,7 @@ namespace System.Configuration { - internal class DefinitionUpdate : Update + internal sealed class DefinitionUpdate : Update { internal DefinitionUpdate(string configKey, bool moved, string updatedXml, SectionRecord sectionRecord) : base(configKey, moved, updatedXml) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/EmptyImpersonationContext.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/EmptyImpersonationContext.cs index b88fa8c0a6c66..28a5972cbcdcd 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/EmptyImpersonationContext.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/EmptyImpersonationContext.cs @@ -4,7 +4,7 @@ namespace System.Configuration { // Used in cases where the Host does not require impersonation. - internal class EmptyImpersonationContext : IDisposable + internal sealed class EmptyImpersonationContext : IDisposable { private static volatile IDisposable s_emptyImpersonationContext; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryId.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryId.cs index 1386922b87d0f..3ccc5b375d07a 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryId.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryId.cs @@ -7,7 +7,7 @@ namespace System.Configuration { // Identifies a factory [DebuggerDisplay("FactoryId {ConfigKey}")] - internal class FactoryId + internal sealed class FactoryId { internal FactoryId(string configKey, string group, string name) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryRecord.cs index d30062e8b3621..01c8b4006f5d1 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/FactoryRecord.cs @@ -8,7 +8,7 @@ namespace System.Configuration { [DebuggerDisplay("FactoryRecord {ConfigKey}")] - internal class FactoryRecord : IConfigErrorInfo + internal sealed class FactoryRecord : IConfigErrorInfo { private const int FlagAllowLocation = 0x0001; // Does the factory allow location directives? private const int FlagRestartOnExternalChanges = 0x0002; // Restart on external changes? diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ImplicitMachineConfigHost.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ImplicitMachineConfigHost.cs index f762d328e584a..36e4cd1786f3b 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ImplicitMachineConfigHost.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ImplicitMachineConfigHost.cs @@ -7,7 +7,7 @@ namespace System.Configuration { - internal class ImplicitMachineConfigHost : DelegatingConfigHost + internal sealed class ImplicitMachineConfigHost : DelegatingConfigHost { private string _machineStreamName; private ConfigurationFileMap _fileMap; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/ConfigSystem.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/ConfigSystem.cs index 27098b83a5838..9de6356fc3bf6 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/ConfigSystem.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/ConfigSystem.cs @@ -4,7 +4,7 @@ namespace System.Configuration.Internal { // The runtime config system - internal class ConfigSystem : IConfigSystem + internal sealed class ConfigSystem : IConfigSystem { private IInternalConfigHost _configHost; private IInternalConfigRoot _configRoot; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/DummyDisposable.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/DummyDisposable.cs index 211c5db394b9a..94282ea1c46ef 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/DummyDisposable.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/DummyDisposable.cs @@ -6,7 +6,7 @@ namespace System.Configuration.Internal /// /// Used to satisfy legacy interfaces. /// - internal class DummyDisposable : IDisposable + internal sealed class DummyDisposable : IDisposable { public void Dispose() { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/FileVersion.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/FileVersion.cs index a572a5246f6be..386e19ccfa1ab 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/FileVersion.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/FileVersion.cs @@ -3,7 +3,7 @@ namespace System.Configuration.Internal { - internal class FileVersion + internal sealed class FileVersion { private readonly bool _exists; private readonly long _fileSize; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/WriteFileContext.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/WriteFileContext.cs index 8033ead725fa2..ae47e20cc90ca 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/WriteFileContext.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/Internal/WriteFileContext.cs @@ -15,7 +15,7 @@ namespace System.Configuration.Internal { - internal class WriteFileContext + internal sealed class WriteFileContext { private const int SavingTimeout = 10000; // 10 seconds private const int SavingRetryInterval = 100; // 100 milliseconds diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/KeyValueInternalCollection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/KeyValueInternalCollection.cs index 77efac671354a..0941d9cbe4376 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/KeyValueInternalCollection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/KeyValueInternalCollection.cs @@ -5,7 +5,7 @@ namespace System.Configuration { - internal class KeyValueInternalCollection : NameValueCollection + internal sealed class KeyValueInternalCollection : NameValueCollection { private readonly AppSettingsSection _root; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationSectionRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationSectionRecord.cs index 03b50f474b7ad..51a5b856064fe 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationSectionRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationSectionRecord.cs @@ -7,7 +7,7 @@ namespace System.Configuration { [DebuggerDisplay("LocationSectionRecord {ConfigKey}")] - internal class LocationSectionRecord + internal sealed class LocationSectionRecord { private List _errors; // errors diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationUpdates.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationUpdates.cs index 1b9b31eaed49d..63cba1292df9f 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationUpdates.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/LocationUpdates.cs @@ -4,7 +4,7 @@ namespace System.Configuration { // LocationUpdates contains all the updates that share the same location characteristics. - internal class LocationUpdates + internal sealed class LocationUpdates { internal LocationUpdates(OverrideModeSetting overrideMode, bool inheritInChildApps) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/PropertySourceInfo.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/PropertySourceInfo.cs index 1a3fe6399a99e..7558081e4cf12 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/PropertySourceInfo.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/PropertySourceInfo.cs @@ -6,7 +6,7 @@ namespace System.Configuration { - internal class PropertySourceInfo + internal sealed class PropertySourceInfo { internal PropertySourceInfo(XmlReader reader) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ReadOnlyNameValueCollection.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ReadOnlyNameValueCollection.cs index a086a973bc8a6..65eb97616ad0e 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ReadOnlyNameValueCollection.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ReadOnlyNameValueCollection.cs @@ -6,7 +6,7 @@ namespace System.Configuration { - internal class ReadOnlyNameValueCollection : NameValueCollection + internal sealed class ReadOnlyNameValueCollection : NameValueCollection { internal ReadOnlyNameValueCollection(IEqualityComparer equalityComparer) : base(equalityComparer) diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionInput.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionInput.cs index 32fc227e9e6e0..2a960418087d5 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionInput.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionInput.cs @@ -7,7 +7,7 @@ namespace System.Configuration { [DebuggerDisplay("SectionInput {SectionXmlInfo.ConfigKey}")] - internal class SectionInput + internal sealed class SectionInput { // result can be null, so we use this object to indicate whether it has been evaluated private static readonly object s_unevaluated = new object(); diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionRecord.cs index 744028a98b9da..8697ea131dbc1 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionRecord.cs @@ -7,7 +7,7 @@ namespace System.Configuration { [DebuggerDisplay("SectionRecord {ConfigKey}")] - internal class SectionRecord + internal sealed class SectionRecord { // // Runtime flags below 0x10000 diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionUpdates.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionUpdates.cs index 7dde1e555e2ff..d56275b403756 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionUpdates.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SectionUpdates.cs @@ -6,7 +6,7 @@ namespace System.Configuration { - internal class SectionUpdates + internal sealed class SectionUpdates { private readonly Hashtable _groups; private readonly string _name; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamInfo.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamInfo.cs index 7caf90c32757b..6400550d00a1a 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamInfo.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamInfo.cs @@ -4,7 +4,7 @@ namespace System.Configuration { // Information about a stream used in configuration - internal class StreamInfo + internal sealed class StreamInfo { // the configSource directive that generated this stream, null for a full config file diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamUpdate.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamUpdate.cs index a942a2edb7528..2f503a6b0e552 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamUpdate.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/StreamUpdate.cs @@ -3,7 +3,7 @@ namespace System.Configuration { - internal class StreamUpdate + internal sealed class StreamUpdate { internal StreamUpdate(string newStreamname) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/UpdateConfigHost.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/UpdateConfigHost.cs index 6655e464999a6..f8e7be8f94efa 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/UpdateConfigHost.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/UpdateConfigHost.cs @@ -10,7 +10,7 @@ namespace System.Configuration { // Configuration host that intercepts calls to filename functions // to support SaveAs to an alternate file stream. - internal class UpdateConfigHost : DelegatingConfigHost + internal sealed class UpdateConfigHost : DelegatingConfigHost { private HybridDictionary _streams; // oldStreamname -> StreamUpdate diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtilWriter.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtilWriter.cs index 7a558efeadbcc..9094bc6c44904 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtilWriter.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/XmlUtilWriter.cs @@ -19,7 +19,7 @@ namespace System.Configuration // // Note also that this class is used at runtime to copy sections, so performance of all // writing functions directly affects application startup time. - internal class XmlUtilWriter + internal sealed class XmlUtilWriter { private const char Space = ' '; private const string NewLine = "\r\n"; diff --git a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs index e03e0ab3c5a84..349cbe833c80a 100644 --- a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs +++ b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs @@ -973,7 +973,7 @@ private static unsafe void EnsureInitializedCore() } /// Provides format strings and related information for use with the current terminal. - internal class TerminalFormatStrings + internal sealed class TerminalFormatStrings { /// Gets the lazily-initialized terminal information for the terminal. public static TerminalFormatStrings Instance { get { return s_instance.Value; } } diff --git a/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs b/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs index ecb29300efe59..9a9414de07a42 100644 --- a/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs +++ b/src/libraries/System.Data.Common/ref/System.Data.Common.manual.cs @@ -9,11 +9,11 @@ namespace System.Data { [System.ComponentModel.TypeConverter(typeof(ConstraintConverter))] public abstract partial class Constraint { } - internal class ConstraintConverter { } + internal sealed class ConstraintConverter { } [System.ComponentModel.TypeConverter(typeof(RelationshipConverter))] public partial class DataRelation { } - internal class RelationshipConverter { } + internal sealed class RelationshipConverter { } public partial class DataColumn { @@ -27,8 +27,8 @@ public partial class DataColumn [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public object DefaultValue { get { throw null; } set { } } } - internal class ColumnTypeConverter { } - internal class DefaultValueTypeConverter { } + internal sealed class ColumnTypeConverter { } + internal sealed class DefaultValueTypeConverter { } public partial class DataTable { @@ -37,7 +37,7 @@ public partial class DataTable [System.Diagnostics.CodeAnalysis.AllowNullAttribute] public System.Data.DataColumn[] PrimaryKey { get { throw null; } set { } } } - internal class PrimaryKeyTypeConverter { } + internal sealed class PrimaryKeyTypeConverter { } public partial class DataView { @@ -46,18 +46,18 @@ public partial class DataView [System.ComponentModel.TypeConverter(typeof(DataTableTypeConverter))] public System.Data.DataTable? Table { get { throw null; } set { } } } - internal class DataTableTypeConverter { } + internal sealed class DataTableTypeConverter { } } namespace System.Data.Common { [System.ComponentModel.TypeConverterAttribute(typeof(DataColumnMapping.DataColumnMappingConverter))] public sealed partial class DataColumnMapping { - internal class DataColumnMappingConverter { } + internal sealed class DataColumnMappingConverter { } } [System.ComponentModel.TypeConverterAttribute(typeof(DataTableMapping.DataTableMappingConverter))] public sealed partial class DataTableMapping { - internal class DataTableMappingConverter { } + internal sealed class DataTableMappingConverter { } } } diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DataCommonEventSource.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DataCommonEventSource.cs index d7e6a2e036121..8150768023a94 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DataCommonEventSource.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DataCommonEventSource.cs @@ -7,7 +7,7 @@ namespace System.Data { [EventSource(Name = "System.Data.DataCommonEventSource")] - internal class DataCommonEventSource : EventSource + internal sealed class DataCommonEventSource : EventSource { internal static readonly DataCommonEventSource Log = new DataCommonEventSource(); private static long s_nextScopeId; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilderDescriptor.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilderDescriptor.cs index 16e792bcdfacc..1ab0b414920ea 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilderDescriptor.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DbConnectionStringBuilderDescriptor.cs @@ -5,7 +5,7 @@ namespace System.Data.Common { - internal class DbConnectionStringBuilderDescriptor : PropertyDescriptor + internal sealed class DbConnectionStringBuilderDescriptor : PropertyDescriptor { internal DbConnectionStringBuilderDescriptor(string propertyName, Type componentType, Type propertyType, bool isReadOnly, Attribute[] attributes) : base(propertyName, attributes) { diff --git a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLString.cs b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLString.cs index e16012f11647b..1482532b98bff 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLString.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLString.cs @@ -974,7 +974,7 @@ internal struct SLcidOrdMapItem { }; // Class to store map of lcids to ordinal - internal class CBuildLcidOrdMap { + internal sealed class CBuildLcidOrdMap { internal SLcidOrdMapItem[] m_rgLcidOrdMap; internal int m_cValidLocales; internal int m_uiPosEnglish; // Start binary searches here - this is index in array, not ordinal diff --git a/src/libraries/System.Data.Common/src/System/Data/SortExpressionBuilder.cs b/src/libraries/System.Data.Common/src/System/Data/SortExpressionBuilder.cs index c5304d94ef346..ab0fe110c4f92 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SortExpressionBuilder.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SortExpressionBuilder.cs @@ -12,7 +12,7 @@ namespace System.Data /// This class represents a combined sort expression build using multiple sort expressions. /// /// - internal class SortExpressionBuilder : IComparer> + internal sealed class SortExpressionBuilder : IComparer> { /** * This class ensures multiple orderby/thenbys are handled correctly. Its semantics is as follows: diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs index 80d1a51b3c2b1..e6c50ba9d3101 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPoolProviderInfo.cs @@ -3,7 +3,7 @@ namespace System.Data.ProviderBase { - internal class DbConnectionPoolProviderInfo + internal sealed class DbConnectionPoolProviderInfo { } } diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs index 33ce321e30486..852265e095d87 100644 --- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs +++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs @@ -9,7 +9,7 @@ namespace System.Data.Odbc { - internal class OdbcMetaDataFactory : DbMetaDataFactory + internal sealed class OdbcMetaDataFactory : DbMetaDataFactory { private readonly struct SchemaFunctionName { diff --git a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs index 238590972dffe..52163899c5481 100644 --- a/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs +++ b/src/libraries/System.Data.OleDb/ref/System.Data.OleDb.Manual.cs @@ -9,7 +9,7 @@ namespace System.Data.OleDb [System.ComponentModel.TypeConverterAttribute(typeof(OleDbParameter.OleDbParameterConverter))] public sealed partial class OleDbParameter : System.Data.Common.DbParameter, System.Data.IDataParameter, System.Data.IDbDataParameter, System.ICloneable { - internal class OleDbParameterConverter : System.ComponentModel.ExpandableObjectConverter + internal sealed class OleDbParameterConverter : System.ComponentModel.ExpandableObjectConverter { } } @@ -25,15 +25,15 @@ public sealed partial class OleDbConnectionStringBuilder : System.Data.Common.Db [System.ComponentModel.TypeConverterAttribute(typeof(OleDbProviderConverter))] public string Provider { get { throw null; } set { } } - internal class OleDbConnectionStringBuilderConverter { } - internal class OleDbServicesConverter { } - internal class OleDbProviderConverter { } + internal sealed class OleDbConnectionStringBuilderConverter { } + internal sealed class OleDbServicesConverter { } + internal sealed class OleDbProviderConverter { } } public sealed partial class OleDbException { [System.ComponentModel.TypeConverterAttribute(typeof(ErrorCodeConverter))] public override int ErrorCode { get { throw null; } } - internal class ErrorCodeConverter { } + internal sealed class ErrorCodeConverter { } } } diff --git a/src/libraries/System.Data.OleDb/src/System/Data/Common/DataCommonEventSource.cs b/src/libraries/System.Data.OleDb/src/System/Data/Common/DataCommonEventSource.cs index cd9e735c27e24..5fc0234b3c9b9 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/Common/DataCommonEventSource.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/Common/DataCommonEventSource.cs @@ -7,7 +7,7 @@ namespace System.Data { [EventSource(Name = "System.Data.DataCommonEventSource")] - internal class DataCommonEventSource : EventSource + internal sealed class DataCommonEventSource : EventSource { internal static readonly DataCommonEventSource Log = new DataCommonEventSource(); private const int TraceEventId = 1; diff --git a/src/libraries/System.Data.OleDb/src/System/Data/Common/DbConnectionPoolKey.cs b/src/libraries/System.Data.OleDb/src/System/Data/Common/DbConnectionPoolKey.cs index 80252bde49e87..e790c71d91719 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/Common/DbConnectionPoolKey.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/Common/DbConnectionPoolKey.cs @@ -8,7 +8,7 @@ namespace System.Data.Common { // DbConnectionPoolKey: Base class implementation of a key to connection pool groups // Only connection string is used as a key - internal class DbConnectionPoolKey : ICloneable + internal sealed class DbConnectionPoolKey : ICloneable { private string? _connectionString; @@ -17,7 +17,7 @@ internal DbConnectionPoolKey(string? connectionString) _connectionString = connectionString; } - protected DbConnectionPoolKey(DbConnectionPoolKey key) + private DbConnectionPoolKey(DbConnectionPoolKey key) { _connectionString = key.ConnectionString; } @@ -27,7 +27,7 @@ object ICloneable.Clone() return new DbConnectionPoolKey(this); } - internal virtual string? ConnectionString + internal string? ConnectionString { get { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs index 1a7d88455adf0..b2d2cd0b20264 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs @@ -1323,7 +1323,7 @@ public ActivityIdFormat IdFormat private set => _state = (_state & ~State.FormatFlags) | (State)((byte)value & (byte)State.FormatFlags); } - private partial class LinkedListNode + private sealed partial class LinkedListNode { public LinkedListNode(T value) => Value = value; public T Value; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs index 900319439fb71..283028fc8d49d 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/ActivitySource.cs @@ -367,7 +367,7 @@ internal void NotifyActivityStop(Activity activity) // and allow enumerating the collection items and execute some action on the enumerated item and can detect any change in the collection // during the enumeration which force restarting the enumeration again. // Caution: We can have the action executed on the same item more than once which is ok in our scenarios. - internal class SynchronizedList + internal sealed class SynchronizedList { private readonly List _list; private uint _version; diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticListener.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticListener.cs index 4aaf2bb37afba..7b1df4d093503 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticListener.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticListener.cs @@ -409,7 +409,7 @@ private bool Remove(AllListenerSubscription subscription) /// One node in the linked list of subscriptions that AllListenerObservable keeps. It is /// IDisposable, and when that is called it removes itself from the list. /// - internal class AllListenerSubscription : IDisposable + internal sealed class AllListenerSubscription : IDisposable { internal AllListenerSubscription(AllListenerObservable owner, IObserver subscriber, AllListenerSubscription? next) { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs index 154cd8c07b6b0..b0b84c6a940ec 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs @@ -160,7 +160,7 @@ namespace System.Diagnostics /// See the DiagnosticSourceEventSourceBridgeTest.cs for more explicit examples of using this bridge. /// [EventSource(Name = "Microsoft-Diagnostics-DiagnosticSource")] - internal class DiagnosticSourceEventSource : EventSource + internal sealed class DiagnosticSourceEventSource : EventSource { public static DiagnosticSourceEventSource Logger = new DiagnosticSourceEventSource(); @@ -506,7 +506,7 @@ internal enum ActivityEvents /// This method also contains that static 'Create/Destroy FilterAndTransformList, which /// simply parse a series of transformation specifications. /// - internal class FilterAndTransform + internal sealed class FilterAndTransform { /// /// Parses filterAndPayloadSpecs which is a list of lines each of which has the from @@ -1185,7 +1185,7 @@ private void Dispose() // This olds one the implicit transform for one type of object. // We remember this type-transform pair in the _firstImplicitTransformsEntry cache. - internal class ImplicitTransformEntry + internal sealed class ImplicitTransformEntry { public Type? Type; public TransformSpec? Transforms; @@ -1196,7 +1196,7 @@ internal class ImplicitTransformEntry /// the DiagnosticSource payload. An example string is OUTSTR=EVENT_VALUE.PROP1.PROP2.PROP3 /// It has a Next field so they can be chained together in a linked list. /// - internal class TransformSpec + internal sealed class TransformSpec { /// /// parse the strings 'spec' from startIdx to endIdx (points just beyond the last considered char) @@ -1261,7 +1261,7 @@ public TransformSpec(string transformSpec, int startIdx, int endIdx, TransformSp /// and efficiently. Thus it represents a '.PROP' in a TransformSpec /// (and a transformSpec has a list of these). /// - internal class PropertySpec + internal sealed class PropertySpec { private const string CurrentActivityPropertyName = "*Activity"; private const string EnumeratePropertyName = "*Enumerate"; @@ -1492,7 +1492,7 @@ public EnumeratePropertyFetch(Type type) : base(type) { } /// operation on the IObserver happens. /// /// - internal class CallbackObserver : IObserver + internal sealed class CallbackObserver : IObserver { public CallbackObserver(Action callback) { _callback = callback; } @@ -1508,7 +1508,7 @@ public void OnError(Exception error) { } // A linked list of IObservable subscriptions (which are IDisposable). // We use this to keep track of the DiagnosticSource subscriptions. // We use this linked list for thread atomicity - internal class Subscriptions + internal sealed class Subscriptions { public Subscriptions(IDisposable subscription, Subscriptions? next) { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/RandomNumberGenerator.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/RandomNumberGenerator.cs index dd151339b5cf4..07cbd932f3ad7 100755 --- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/RandomNumberGenerator.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/RandomNumberGenerator.cs @@ -6,7 +6,7 @@ namespace System.Diagnostics /// /// RandomNumberGenerator implementation is the 64-bit random number generator based on the Xoshiro256StarStar algorithm (known as shift-register generators). /// - internal class RandomNumberGenerator + internal sealed class RandomNumberGenerator { [ThreadStatic] private static RandomNumberGenerator? t_random; diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs index 888af1f7273e3..8ca40469ba095 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/EventLogInternal.cs @@ -15,7 +15,7 @@ namespace System.Diagnostics { - internal class EventLogInternal : IDisposable, ISupportInitialize + internal sealed class EventLogInternal : IDisposable, ISupportInitialize { private EventLogEntryCollection entriesCollection; internal string logName; diff --git a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadataCachedInformation.cs b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadataCachedInformation.cs index 2db49e48224c7..aa62843117ae0 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadataCachedInformation.cs +++ b/src/libraries/System.Diagnostics.EventLog/src/System/Diagnostics/Reader/ProviderMetadataCachedInformation.cs @@ -13,7 +13,7 @@ namespace System.Diagnostics.Eventing.Reader /// for this is so the cache can easily Dispose the metadata object without worrying /// about who is using it. /// - internal class ProviderMetadataCachedInformation + internal sealed class ProviderMetadataCachedInformation { private readonly Dictionary _cache; private readonly int _maximumCacheSize; diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerfCounterSection.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerfCounterSection.cs index d3a7072f77a98..7169e201f65e3 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerfCounterSection.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerfCounterSection.cs @@ -5,7 +5,7 @@ namespace System.Diagnostics { - internal class PerfCounterSection : ConfigurationElement + internal sealed class PerfCounterSection : ConfigurationElement { private static readonly ConfigurationProperty s_propFileMappingSize = new ConfigurationProperty("filemappingsize", typeof(int), 524288, ConfigurationPropertyOptions.None); private static readonly ConfigurationPropertyCollection s_properties = new ConfigurationPropertyCollection { s_propFileMappingSize }; diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs index 17fdccfa37130..938bb8818298e 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/PerformanceCounterLib.cs @@ -20,7 +20,7 @@ namespace System.Diagnostics { - internal class PerformanceCounterLib + internal sealed class PerformanceCounterLib { internal const string PerfShimName = "netfxperf.dll"; private const string PerfShimFullNameSuffix = @"\netfxperf.dll"; @@ -1265,7 +1265,7 @@ internal static void UnregisterCategory(string categoryName) } } - internal class PerformanceMonitor + internal sealed class PerformanceMonitor { private PerformanceDataRegistryKey perfDataKey; private readonly string machineName; @@ -1378,7 +1378,7 @@ internal void ReleaseData(byte[] data) } - internal class CategoryEntry + internal sealed class CategoryEntry { internal int NameIndex; internal int HelpIndex; @@ -1676,7 +1676,7 @@ private void CheckDisposed() } } - internal class CounterDefinitionSample + internal sealed class CounterDefinitionSample { internal readonly int _nameIndex; internal readonly int _counterType; diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs index f21fdb73f2f0a..7ef3659bbd3e4 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs @@ -1857,7 +1857,7 @@ private sealed class CategoryData } } - internal class ProcessData + internal sealed class ProcessData { public ProcessData(int pid, long startTime) { diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SystemDiagnosticsSection.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SystemDiagnosticsSection.cs index d13ec58638aad..aa40d83aed03a 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SystemDiagnosticsSection.cs +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SystemDiagnosticsSection.cs @@ -5,7 +5,7 @@ namespace System.Diagnostics { - internal class SystemDiagnosticsSection : ConfigurationSection + internal sealed class SystemDiagnosticsSection : ConfigurationSection { private static readonly ConfigurationProperty s_propPerfCounters = new ConfigurationProperty("performanceCounters", typeof(PerfCounterSection), new PerfCounterSection(), ConfigurationPropertyOptions.None); private static readonly ConfigurationPropertyCollection s_properties = new ConfigurationPropertyCollection { s_propPerfCounters }; diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs index 08ff0741e0e1a..15b5220a2621c 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/PerformanceCounterLib.cs @@ -189,7 +189,7 @@ private Dictionary GetStringTable(bool isHelp) #endif } - internal class PerformanceMonitor + internal sealed class PerformanceMonitor { #if FEATURE_REGISTRY private RegistryKey _perfDataKey; diff --git a/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs b/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs index b15da6d123b96..95a445f8500fa 100644 --- a/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs +++ b/src/libraries/System.Diagnostics.StackTrace/src/System/Diagnostics/StackTraceSymbols.cs @@ -10,7 +10,7 @@ namespace System.Diagnostics { - internal class StackTraceSymbols : IDisposable + internal sealed class StackTraceSymbols : IDisposable { private readonly ConditionalWeakTable _metadataCache; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs index 8e2f891799f0e..9c6a217abbc1e 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADAMStoreCtx.cs @@ -15,7 +15,7 @@ namespace System.DirectoryServices.AccountManagement { - internal partial class ADAMStoreCtx : ADStoreCtx + internal sealed partial class ADAMStoreCtx : ADStoreCtx { private const int mappingIndex = 1; private List _cachedBindableObjectList; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNConstraintLinkedAttrSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNConstraintLinkedAttrSet.cs index 5e89d45e7e908..a0cbd527c958d 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNConstraintLinkedAttrSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNConstraintLinkedAttrSet.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ADDNConstraintLinkedAttrSet : ADDNLinkedAttrSet + internal sealed class ADDNConstraintLinkedAttrSet : ADDNLinkedAttrSet { /// /// diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNLinkedAttrSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNLinkedAttrSet.cs index 7d4739ae1c36d..3174e96bcd672 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNLinkedAttrSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADDNLinkedAttrSet.cs @@ -1387,7 +1387,7 @@ internal enum ExpansionMode ASQ = 1, } - internal class ADDNLinkedAttrSetBookmark : ResultSetBookmark + internal sealed class ADDNLinkedAttrSetBookmark : ResultSetBookmark { public Dictionary usersVisited; public List groupsToVisit; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADEntriesSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADEntriesSet.cs index b100cff9817ac..94f1be8347062 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADEntriesSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADEntriesSet.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ADEntriesSet : ResultSet + internal sealed class ADEntriesSet : ResultSet { private readonly SearchResultCollection _searchResults; private readonly ADStoreCtx _storeCtx; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs index 5576526f50093..845afc0533f96 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/ADStoreKey.cs @@ -7,7 +7,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ADStoreKey : StoreKey + internal sealed class ADStoreKey : StoreKey { // For regular ADStoreKeys private System.Guid _objectGuid; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/DSPropertyCollection.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/DSPropertyCollection.cs index 65498e61b4819..62483eb22b56a 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/DSPropertyCollection.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/DSPropertyCollection.cs @@ -13,7 +13,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class dSPropertyCollection + internal sealed class dSPropertyCollection { private readonly PropertyCollection _pc; private readonly ResultPropertyCollection _rp; @@ -41,7 +41,7 @@ public dSPropertyValueCollection this[string propertyName] } } - internal class dSPropertyValueCollection + internal sealed class dSPropertyValueCollection { private readonly PropertyValueCollection _pc; private readonly ResultPropertyValueCollection _rc; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/QBEMatchType.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/QBEMatchType.cs index 764c1a953e97d..78d8bdf301fe7 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/QBEMatchType.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/QBEMatchType.cs @@ -5,7 +5,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class QbeMatchType + internal sealed class QbeMatchType { private object _value; private MatchType _matchType; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/RangeRetriever.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/RangeRetriever.cs index a39d0c626102a..0be16009b54b8 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/RangeRetriever.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/RangeRetriever.cs @@ -15,7 +15,7 @@ namespace System.DirectoryServices.AccountManagement /// if disposeDirEntry parameter is set to true in its constructor. /// /// - internal class RangeRetriever : CollectionBase, IEnumerable, IEnumerator, IDisposable + internal sealed class RangeRetriever : CollectionBase, IEnumerable, IEnumerator, IDisposable { /// /// diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SDSCache.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SDSCache.cs index c60aafa0e15c1..1b0c87719373e 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SDSCache.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SDSCache.cs @@ -14,7 +14,7 @@ namespace System.DirectoryServices.AccountManagement /// /// This is a class designed to cache DirectoryEntires instead of creating them every time. /// - internal class SDSCache + internal sealed class SDSCache { public static SDSCache Domain { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs index 109b59086c4bc..a06b3ac12c489 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/SidList.cs @@ -12,7 +12,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class SidList + internal sealed class SidList { internal SidList(List sidListByteFormat) : this(sidListByteFormat, null, null) { @@ -66,7 +66,7 @@ internal SidList(UnsafeNativeMethods.SID_AND_ATTR[] sidAndAttr) TranslateSids(null, pSids); } - protected void TranslateSids(string target, IntPtr[] pSids) + private void TranslateSids(string target, IntPtr[] pSids) { GlobalDebug.WriteLineIf(GlobalDebug.Info, "AuthZSet", "SidList: processing {0} SIDs", pSids.Length); @@ -305,7 +305,7 @@ public int Compare(SidListEntry entry1, SidListEntry entry2) } ********/ - internal class SidListEntry : IDisposable + internal sealed class SidListEntry : IDisposable { public IntPtr pSid = IntPtr.Zero; public string name; @@ -313,7 +313,7 @@ internal class SidListEntry : IDisposable // // IDisposable // - public virtual void Dispose() + public void Dispose() { if (pSid != IntPtr.Zero) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs index bd9cc4962d7eb..0e7a2f55840a5 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AD/TokenGroupsSet.cs @@ -11,7 +11,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class TokenGroupSet : ResultSet + internal sealed class TokenGroupSet : ResultSet { internal TokenGroupSet( string userDN, diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AccountInfo.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AccountInfo.cs index 822a5d0b1ab6c..326d14d4e5ca3 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AccountInfo.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AccountInfo.cs @@ -11,7 +11,7 @@ namespace System.DirectoryServices.AccountManagement #if TESTHOOK public class AccountInfo #else - internal class AccountInfo + internal sealed class AccountInfo #endif { // diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs index 19efbfba03ffd..4c6491929ad38 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/AuthZSet.cs @@ -13,7 +13,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class AuthZSet : ResultSet + internal sealed class AuthZSet : ResultSet { internal AuthZSet( byte[] userSid, diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs index fc0e04949d57c..1486d9010d574 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ConfigurationHandler.cs @@ -10,7 +10,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ConfigSettings + internal sealed class ConfigSettings { public ConfigSettings(DebugLevel debugLevel, string debugLogFile) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/EmptySet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/EmptySet.cs index c5f89702131c6..3a1551910461c 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/EmptySet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/EmptySet.cs @@ -6,7 +6,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class EmptySet : BookmarkableResultSet + internal sealed class EmptySet : BookmarkableResultSet { internal EmptySet() { @@ -43,7 +43,7 @@ internal override void RestoreBookmark(ResultSetBookmark bookmark) } } - internal class EmptySetBookmark : ResultSetBookmark + internal sealed class EmptySetBookmark : ResultSetBookmark { } } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionCache.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionCache.cs index c7db802646b59..dc814522927cd 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionCache.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionCache.cs @@ -8,7 +8,7 @@ namespace System.DirectoryServices.AccountManagement using System.Collections; using System.DirectoryServices; - internal class ExtensionCacheValue + internal sealed class ExtensionCacheValue { internal ExtensionCacheValue(object[] value) { @@ -47,7 +47,7 @@ internal MatchType MatchType private readonly MatchType _matchType; } - internal class ExtensionCache + internal sealed class ExtensionCache { private readonly Dictionary _cache = new Dictionary(); diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionHelper.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionHelper.cs index 212b1f664952b..1a7c3ac330f67 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionHelper.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ExtensionHelper.cs @@ -7,7 +7,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ExtensionHelper + internal sealed class ExtensionHelper { internal ExtensionHelper(Principal p) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/FindResultEnumerator.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/FindResultEnumerator.cs index fc60e2c928a97..2b892033b299c 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/FindResultEnumerator.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/FindResultEnumerator.cs @@ -8,7 +8,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class FindResultEnumerator : IEnumerator, IEnumerator + internal sealed class FindResultEnumerator : IEnumerator, IEnumerator { // // Public properties diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityClaim.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityClaim.cs index 41510a4b48292..fd84e5354ebf8 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityClaim.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityClaim.cs @@ -6,7 +6,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class IdentityClaim + internal sealed class IdentityClaim { public string UrnValue { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityReference.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityReference.cs index 5891b2d061499..d39223855093a 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityReference.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/IdentityReference.cs @@ -6,7 +6,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class IdentityReference + internal sealed class IdentityReference { public string UrnValue { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs index 13713bcb4e5a4..e208968250bb7 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/NetCred.cs @@ -10,7 +10,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class NetCred + internal sealed class NetCred { public NetCred(string username, string password) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Pair.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Pair.cs index d83fc70ebe17e..3e4d71c5e1385 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Pair.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/Pair.cs @@ -6,7 +6,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class Pair + internal sealed class Pair { // // Constructor diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PasswordInfo.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PasswordInfo.cs index a478199410e07..3e22c9282dbd7 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PasswordInfo.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PasswordInfo.cs @@ -10,7 +10,7 @@ namespace System.DirectoryServices.AccountManagement #if TESTHOOK public class PasswordInfo #else - internal class PasswordInfo + internal sealed class PasswordInfo #endif { // diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PrincipalCollectionEnumerator.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PrincipalCollectionEnumerator.cs index 0b7efe1cd818e..d247d9fa03d7c 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PrincipalCollectionEnumerator.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/PrincipalCollectionEnumerator.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class PrincipalCollectionEnumerator : IEnumerator, IEnumerator + internal sealed class PrincipalCollectionEnumerator : IEnumerator, IEnumerator { // // Public properties diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/QbeFilterDescription.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/QbeFilterDescription.cs index 49b0fda2afb02..32bb7e164ebab 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/QbeFilterDescription.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/QbeFilterDescription.cs @@ -10,7 +10,7 @@ namespace System.DirectoryServices.AccountManagement // // A collection of individual property filters // - internal class QbeFilterDescription + internal sealed class QbeFilterDescription { private readonly ArrayList _filtersToApply = new ArrayList(); @@ -120,236 +120,236 @@ public object Extra // The derived classes - internal class DescriptionFilter : FilterBase + internal sealed class DescriptionFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalDescription; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class SidFilter : FilterBase + internal sealed class SidFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalSid; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class SamAccountNameFilter : FilterBase + internal sealed class SamAccountNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalSamAccountName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class DistinguishedNameFilter : FilterBase + internal sealed class DistinguishedNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalDistinguishedName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class GuidFilter : FilterBase + internal sealed class GuidFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalGuid; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class IdentityClaimFilter : FilterBase + internal sealed class IdentityClaimFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalIdentityClaims; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class UserPrincipalNameFilter : FilterBase + internal sealed class UserPrincipalNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalUserPrincipalName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class StructuralObjectClassFilter : FilterBase + internal sealed class StructuralObjectClassFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalStructuralObjectClass; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class NameFilter : FilterBase + internal sealed class NameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class DisplayNameFilter : FilterBase + internal sealed class DisplayNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalDisplayName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class CertificateFilter : FilterBase + internal sealed class CertificateFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AuthenticablePrincipalCertificates; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class AuthPrincEnabledFilter : FilterBase + internal sealed class AuthPrincEnabledFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AuthenticablePrincipalEnabled; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class PermittedWorkstationFilter : FilterBase + internal sealed class PermittedWorkstationFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoPermittedWorkstations; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class PermittedLogonTimesFilter : FilterBase + internal sealed class PermittedLogonTimesFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoPermittedLogonTimes; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class ExpirationDateFilter : FilterBase + internal sealed class ExpirationDateFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoExpirationDate; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class SmartcardLogonRequiredFilter : FilterBase + internal sealed class SmartcardLogonRequiredFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoSmartcardRequired; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class DelegationPermittedFilter : FilterBase + internal sealed class DelegationPermittedFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoDelegationPermitted; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class HomeDirectoryFilter : FilterBase + internal sealed class HomeDirectoryFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoHomeDirectory; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class HomeDriveFilter : FilterBase + internal sealed class HomeDriveFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoHomeDrive; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class ScriptPathFilter : FilterBase + internal sealed class ScriptPathFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoScriptPath; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class PasswordNotRequiredFilter : FilterBase + internal sealed class PasswordNotRequiredFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoPasswordNotRequired; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class PasswordNeverExpiresFilter : FilterBase + internal sealed class PasswordNeverExpiresFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoPasswordNeverExpires; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class CannotChangePasswordFilter : FilterBase + internal sealed class CannotChangePasswordFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoCannotChangePassword; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class AllowReversiblePasswordEncryptionFilter : FilterBase + internal sealed class AllowReversiblePasswordEncryptionFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoAllowReversiblePasswordEncryption; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class GivenNameFilter : FilterBase + internal sealed class GivenNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserGivenName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class MiddleNameFilter : FilterBase + internal sealed class MiddleNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserMiddleName; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class SurnameFilter : FilterBase + internal sealed class SurnameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserSurname; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class EmailAddressFilter : FilterBase + internal sealed class EmailAddressFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserEmailAddress; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class VoiceTelephoneNumberFilter : FilterBase + internal sealed class VoiceTelephoneNumberFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserVoiceTelephoneNumber; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class EmployeeIDFilter : FilterBase + internal sealed class EmployeeIDFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.UserEmployeeID; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class GroupIsSecurityGroupFilter : FilterBase + internal sealed class GroupIsSecurityGroupFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.GroupIsSecurityGroup; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class GroupScopeFilter : FilterBase + internal sealed class GroupScopeFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.GroupGroupScope; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class ServicePrincipalNameFilter : FilterBase + internal sealed class ServicePrincipalNameFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.ComputerServicePrincipalNames; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class ExtensionCacheFilter : FilterBase + internal sealed class ExtensionCacheFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PrincipalExtensionCache; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class BadPasswordAttemptFilter : FilterBase + internal sealed class BadPasswordAttemptFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoLastBadPasswordAttempt; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class LastLogonTimeFilter : FilterBase + internal sealed class LastLogonTimeFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoLastLogon; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class LockoutTimeFilter : FilterBase + internal sealed class LockoutTimeFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoAcctLockoutTime; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class ExpiredAccountFilter : FilterBase + internal sealed class ExpiredAccountFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoExpiredAccount; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class PasswordSetTimeFilter : FilterBase + internal sealed class PasswordSetTimeFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.PwdInfoLastPasswordSet; public override string PropertyName { get { return PropertyNameStatic; } } } - internal class BadLogonCountFilter : FilterBase + internal sealed class BadLogonCountFilter : FilterBase { public const string PropertyNameStatic = PropertyNames.AcctInfoBadLogonCount; public override string PropertyName { get { return PropertyNameStatic; } } diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMGroupsSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMGroupsSet.cs index b4f4afe53b6d4..22a545a591ebf 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMGroupsSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMGroupsSet.cs @@ -12,7 +12,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class SAMGroupsSet : ResultSet + internal sealed class SAMGroupsSet : ResultSet { internal SAMGroupsSet(UnsafeNativeMethods.IADsMembers iADsMembers, SAMStoreCtx storeCtx, DirectoryEntry ctxBase) { diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs index e8070d4ca3534..f8134abdbe127 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMMembersSet.cs @@ -13,7 +13,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class SAMMembersSet : BookmarkableResultSet + internal sealed class SAMMembersSet : BookmarkableResultSet { internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase) { @@ -597,7 +597,7 @@ public override void Dispose() private ResultSet _foreignResultSet; // current foreign group's ResultSet (if enumerating via proxy to foreign group) } - internal class SAMMembersSetBookmark : ResultSetBookmark + internal sealed class SAMMembersSetBookmark : ResultSetBookmark { public List groupsToVisit; public List groupsVisited; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMQuerySet.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMQuerySet.cs index 6b1fb34211c7d..7af3ed85f00ce 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMQuerySet.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMQuerySet.cs @@ -11,7 +11,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class SAMQuerySet : ResultSet + internal sealed class SAMQuerySet : ResultSet { // We will iterate over all principals under ctxBase, returning only those which are in the list of types and which // satisfy ALL the matching properties. @@ -202,7 +202,7 @@ internal abstract class SAMMatcher // The matcher routines for query-by-example support // - internal class QbeMatcher : SAMMatcher + internal sealed class QbeMatcher : SAMMatcher { private readonly QbeFilterDescription _propertiesToMatch; @@ -666,7 +666,7 @@ private static bool GroupTypeMatcher(FilterBase filter, string winNTPropertyName // The matcher routines for FindBy* support // - internal class FindByDateMatcher : SAMMatcher + internal sealed class FindByDateMatcher : SAMMatcher { internal enum DateProperty { @@ -804,7 +804,7 @@ private bool TestForMatch(Nullable nullableStoreValue) } } - internal class GroupMemberMatcher : SAMMatcher + internal sealed class GroupMemberMatcher : SAMMatcher { private readonly byte[] _memberSidToMatch; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs index 65f616ea199fb..9f57bc6e5e796 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.AccountManagement { - internal partial class SAMStoreCtx : StoreCtx + internal sealed partial class SAMStoreCtx : StoreCtx { private readonly DirectoryEntry _ctxBase; private readonly object _ctxBaseLock = new object(); // when mutating ctxBase diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs index a06d1646eb9a8..f1f39b9b53ef6 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_LoadStore.cs @@ -17,7 +17,7 @@ namespace System.DirectoryServices.AccountManagement { - internal partial class SAMStoreCtx : StoreCtx + internal sealed partial class SAMStoreCtx : StoreCtx { // // Native <--> Principal diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_Query.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_Query.cs index b48fe5051878d..fea8ea271a984 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_Query.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreCtx_Query.cs @@ -12,7 +12,7 @@ namespace System.DirectoryServices.AccountManagement { - internal partial class SAMStoreCtx : StoreCtx + internal sealed partial class SAMStoreCtx : StoreCtx { // // Query operations diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs index 11b7612c9ab5e..4d03a2fd5e83a 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/SAM/SAMStoreKey.cs @@ -7,7 +7,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class SAMStoreKey : StoreKey + internal sealed class SAMStoreKey : StoreKey { private readonly byte[] _sid; private readonly string _machineName; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollection.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollection.cs index eb16ae3118c16..c177f70c758f1 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollection.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollection.cs @@ -8,7 +8,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class TrackedCollection : ICollection, ICollection, IEnumerable, IEnumerable + internal sealed class TrackedCollection : ICollection, ICollection, IEnumerable, IEnumerable { // // ICollection @@ -197,7 +197,7 @@ public bool Remove(T value) // Private implementation // - internal class ValueEl + internal sealed class ValueEl { public bool isInserted; diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollectionEnumerator.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollectionEnumerator.cs index 81cd5ab77c9a8..279243e436353 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollectionEnumerator.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/TrackedCollectionEnumerator.cs @@ -8,7 +8,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class TrackedCollectionEnumerator : IEnumerator, IEnumerator + internal sealed class TrackedCollectionEnumerator : IEnumerator, IEnumerator { // // Public properties diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/UnknownPrincipal.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/UnknownPrincipal.cs index 238d4b3457349..bec63840291cd 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/UnknownPrincipal.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/UnknownPrincipal.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.AccountManagement { [DirectoryRdnPrefix("CN")] - internal class UnknownPrincipal : Principal + internal sealed class UnknownPrincipal : Principal { // // Public constructors diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ValueCollectionEnumerator.cs b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ValueCollectionEnumerator.cs index 838af2be33f5d..dc9f7326b5c53 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ValueCollectionEnumerator.cs +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System/DirectoryServices/AccountManagement/ValueCollectionEnumerator.cs @@ -8,7 +8,7 @@ namespace System.DirectoryServices.AccountManagement { - internal class ValueCollectionEnumerator : IEnumerator, IEnumerator + internal sealed class ValueCollectionEnumerator : IEnumerator, IEnumerator // T must be a ValueType { // diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapAsyncResult.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapAsyncResult.cs index 25a90ad33f3fc..3b83e360ee28a 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapAsyncResult.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapAsyncResult.cs @@ -58,7 +58,7 @@ public LdapAsyncWaitHandle(SafeWaitHandle handle) : base() } } - internal class LdapRequestState + internal sealed class LdapRequestState { internal DirectoryResponse _response; internal LdapAsyncResult _ldapAsync; @@ -75,7 +75,7 @@ internal enum ResultsStatus Done = 2 } - internal class LdapPartialAsyncResult : LdapAsyncResult + internal sealed class LdapPartialAsyncResult : LdapAsyncResult { internal LdapConnection _con; internal int _messageID = -1; diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapPartialResultsProcessor.cs b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapPartialResultsProcessor.cs index ca6744dde1ea1..4f5b6b37f529a 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapPartialResultsProcessor.cs +++ b/src/libraries/System.DirectoryServices.Protocols/src/System/DirectoryServices/Protocols/ldap/LdapPartialResultsProcessor.cs @@ -9,7 +9,7 @@ namespace System.DirectoryServices.Protocols { - internal class LdapPartialResultsProcessor + internal sealed class LdapPartialResultsProcessor { private readonly ArrayList _resultList = new ArrayList(); private readonly ManualResetEvent _workThreadWaitHandle; @@ -333,7 +333,7 @@ private void AddResult(SearchResponse partialResults, SearchResponse newResult) } } - internal class PartialResultsRetriever + internal sealed class PartialResultsRetriever { private readonly ManualResetEvent _workThreadWaitHandle; private readonly LdapPartialResultsProcessor _processor; diff --git a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs index 9989215fd6176..2462cbec76e9f 100644 --- a/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs +++ b/src/libraries/System.DirectoryServices/ref/System.DirectoryServices.manual.cs @@ -8,5 +8,5 @@ namespace System.DirectoryServices { [System.ComponentModel.TypeConverter(typeof(DirectoryEntryConverter))] public partial class DirectoryEntry { } - internal class DirectoryEntryConverter { } + internal sealed class DirectoryEntryConverter { } } diff --git a/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs b/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs index d834eb54409ef..080dba7450b86 100644 --- a/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs +++ b/src/libraries/System.DirectoryServices/src/Interop/AdsValueHelper2.cs @@ -21,7 +21,7 @@ internal struct SystemTime } [StructLayout(LayoutKind.Sequential)] - internal class DnWithBinary + internal sealed class DnWithBinary { public int dwLength; public IntPtr lpBinaryValue; // GUID of directory object @@ -29,7 +29,7 @@ internal class DnWithBinary } [StructLayout(LayoutKind.Sequential)] - internal class DnWithString + internal sealed class DnWithString { public IntPtr pszStringValue; // associated value public IntPtr pszDNString; // Distinguished Name @@ -38,7 +38,7 @@ internal class DnWithString /// /// Helper class for dealing with struct AdsValue. /// - internal class AdsValueHelper + internal sealed class AdsValueHelper { public AdsValue adsvalue; private GCHandle _pinnedHandle; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ADSearcher.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ADSearcher.cs index 898d79cc0ee38..098a2bbf2a745 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ADSearcher.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ADSearcher.cs @@ -5,7 +5,7 @@ namespace System.DirectoryServices.ActiveDirectory { - internal class ADSearcher + internal sealed class ADSearcher { private readonly DirectorySearcher _searcher; private static readonly TimeSpan s_defaultTimeSpan = new TimeSpan(0, 120, 0); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySyntax.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySyntax.cs index 6d31c04bb8aba..7b6c094b56eeb 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySyntax.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/ActiveDirectorySyntax.cs @@ -30,7 +30,7 @@ public enum ActiveDirectorySyntax : int ReplicaLink = 22 } - internal class OMObjectClass + internal sealed class OMObjectClass { public OMObjectClass(byte[] data) => Data = data; @@ -58,7 +58,7 @@ public bool Equals(OMObjectClass OMObjectClass) public byte[] Data { get; } } - internal class Syntax + internal sealed class Syntax { public readonly string attributeSyntax; public readonly int oMSyntax; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryEntryManager.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryEntryManager.cs index 296d91115d325..d30f70c40eb2e 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryEntryManager.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/DirectoryEntryManager.cs @@ -10,7 +10,7 @@ namespace System.DirectoryServices.ActiveDirectory /// Internal class that is used as a key in the hashtable /// of directory entries /// - internal class DistinguishedName + internal sealed class DistinguishedName { public DistinguishedName(string dn) { @@ -81,7 +81,7 @@ public override string ToString() /// and creates a new directory entry (for a given dn) only if /// it doesn't already exist /// - internal class DirectoryEntryManager + internal sealed class DirectoryEntryManager { private readonly Hashtable _directoryEntries = new Hashtable(); private string? _bindingPrefix; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/AdsVLV.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/AdsVLV.cs index 4f9bb0a6eed2e..4f9b73107991c 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/AdsVLV.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/AdsVLV.cs @@ -6,7 +6,7 @@ namespace System.DirectoryServices { [StructLayout(LayoutKind.Sequential)] - internal class AdsVLV + internal sealed class AdsVLV { public int beforeCount; public int afterCount; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs index 2bb99779757c8..f8af94cfacd86 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/Design/DirectoryEntryConverter.cs @@ -7,7 +7,7 @@ namespace System.DirectoryServices.Design { - internal class DirectoryEntryConverter : TypeConverter + internal sealed class DirectoryEntryConverter : TypeConverter { private static StandardValuesCollection? s_values; private static readonly Hashtable s_componentsCreated = new Hashtable(StringComparer.OrdinalIgnoreCase); diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/SchemaNameCollection.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/SchemaNameCollection.cs index 2a2c6ab2a6ba8..853c659ecfd88 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/SchemaNameCollection.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/SchemaNameCollection.cs @@ -218,7 +218,7 @@ void ICollection.CopyTo(Array array, int index) // this class and HintsDelegateWrapper exist only because you can't create // a delegate to a property's accessors. You have to supply methods. So these // classes wrap an object and supply properties as methods. - internal class FilterDelegateWrapper + internal sealed class FilterDelegateWrapper { private readonly UnsafeNativeMethods.IAdsContainer _obj; internal FilterDelegateWrapper(UnsafeNativeMethods.IAdsContainer wrapped) diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs index 57a538561aa4e..fc4c1d957d18b 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Comdlg32.cs @@ -15,7 +15,7 @@ internal static partial class Comdlg32 internal static extern bool PrintDlg([In, Out] PRINTDLGX86 lppd); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal class PRINTDLG + internal sealed class PRINTDLG { internal int lStructSize; internal IntPtr hwndOwner; @@ -39,7 +39,7 @@ internal class PRINTDLG } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)] - internal class PRINTDLGX86 + internal sealed class PRINTDLGX86 { internal int lStructSize; internal IntPtr hwndOwner; diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs index 875dabd9ef392..6c3e188d9a7fc 100644 --- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs +++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Gdi32.cs @@ -101,7 +101,7 @@ internal unsafe struct BITMAPINFO_FLAT } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - internal class DOCINFO + internal sealed class DOCINFO { internal int cbSize = 20; internal string? lpszDocName; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs index b74cb3d1374fc..0bb94bd19b8ce 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs @@ -44,7 +44,7 @@ public static bool IsSecurityOrCriticalException(Exception ex) /// Also avoid calling Remove(item). Instead call RemoveByHashCode(item) /// to make sure dead refs are removed. /// - internal class WeakRefCollection : IList + internal sealed class WeakRefCollection : IList { internal WeakRefCollection() : this(4) { } @@ -227,7 +227,7 @@ public int Add(object? value) /// added to a collection since Contains(WeakRef(item)) and Remove(WeakRef(item)) would not be able to /// identify the item. /// - internal class WeakRefObject + internal sealed class WeakRefObject { private readonly int _hash; private readonly WeakReference _weakHolder; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs index 1d30015640544..37bd0481c5067 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.Unix.cs @@ -12,7 +12,7 @@ namespace System.Drawing { - internal partial class SafeNativeMethods + internal static partial class SafeNativeMethods { internal unsafe partial class Gdip { diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GraphicsContext.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GraphicsContext.cs index fcffae054bd25..82340aa17020f 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GraphicsContext.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GraphicsContext.cs @@ -8,7 +8,7 @@ namespace System.Drawing /// /// Contains information about the context of a Graphics object. /// - internal class GraphicsContext : IDisposable + internal sealed class GraphicsContext : IDisposable { /// /// The state that identifies the context. diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs index 9c4b2ddd921fe..bd14e2d73e7f7 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs @@ -101,7 +101,7 @@ internal abstract class ImageData }; [StructLayout(LayoutKind.Sequential)] - internal class IconImage : ImageData + internal sealed class IconImage : ImageData { internal BitmapInfoHeader iconHeader; //image header internal uint[]? iconColors; //colors table @@ -110,7 +110,7 @@ internal class IconImage : ImageData }; [StructLayout(LayoutKind.Sequential)] - internal class IconDump : ImageData + internal sealed class IconDump : ImageData { internal byte[]? data; }; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs index 8c31fc37e64f2..6bd26a336c1bf 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Windows.cs @@ -957,7 +957,7 @@ internal static class Ole } [StructLayout(LayoutKind.Sequential)] - internal class PICTDESC + internal sealed class PICTDESC { internal int cbSizeOfStruct; public int picType; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ImageAnimator.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ImageAnimator.Unix.cs index 807dcc81fe08f..0da66c044b546 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/ImageAnimator.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ImageAnimator.Unix.cs @@ -40,7 +40,7 @@ namespace System.Drawing { - internal class AnimateEventArgs : EventArgs + internal sealed class AnimateEventArgs : EventArgs { private int frameCount; @@ -165,7 +165,7 @@ private static void UpdateImageFrame(Image image) } } - internal class WorkerThread + internal sealed class WorkerThread { private EventHandler frameChangeHandler; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageCodecInfoPrivate.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageCodecInfoPrivate.cs index fd67c140ebe23..d47f98c9f1523 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageCodecInfoPrivate.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/ImageCodecInfoPrivate.cs @@ -7,7 +7,7 @@ namespace System.Drawing.Imaging // sdkinc\imaging.h [StructLayout(LayoutKind.Sequential, Pack = 8)] - internal class ImageCodecInfoPrivate + internal sealed class ImageCodecInfoPrivate { #pragma warning disable CS0618 // Legacy code: We don't care about using obsolete API's. [MarshalAs(UnmanagedType.Struct)] diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderEmf.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderEmf.cs index c03dfc4c55784..eb2c7f73a9533 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderEmf.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderEmf.cs @@ -6,7 +6,7 @@ namespace System.Drawing.Imaging using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential)] - internal class MetafileHeaderEmf + internal sealed class MetafileHeaderEmf { /// The ENHMETAHEADER structure is defined natively as a union with WmfHeader. /// Extreme care should be taken if changing the layout of the corresponding managed diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderWmf.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderWmf.cs index b5d88328ec9d9..d42e1ceaea7b2 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderWmf.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Imaging/MetafileHeaderWmf.cs @@ -6,7 +6,7 @@ namespace System.Drawing.Imaging using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential, Pack = 8)] - internal class MetafileHeaderWmf + internal sealed class MetafileHeaderWmf { /// The ENHMETAHEADER structure is defined natively as a union with WmfHeader. /// Extreme care should be taken if changing the layout of the corresponding managed diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintPreviewGraphics.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintPreviewGraphics.cs index d74432e34bffc..f4907591b8d34 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintPreviewGraphics.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintPreviewGraphics.cs @@ -10,7 +10,7 @@ namespace System.Drawing /// /// Retrieves the printer graphics during preview. /// - internal class PrintPreviewGraphics + internal sealed class PrintPreviewGraphics { private readonly PrintPageEventArgs _printPageEventArgs; private readonly PrintDocument _printDocument; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs index edc80e97d3d23..3324fa97cd1ef 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs @@ -1028,7 +1028,7 @@ internal static void GetPrintDialogInfo(string printer, ref string port, ref str PrintingServices.GetPrintDialogInfo(printer, ref port, ref type, ref status, ref comment); } - internal class Printer + internal sealed class Printer { public readonly string Comment; public readonly string Port; @@ -1046,7 +1046,7 @@ public Printer(string port, string type, string status, string comment) } } - internal class GraphicsPrinter + internal sealed class GraphicsPrinter { private Graphics? graphics; private IntPtr hDC; diff --git a/src/libraries/System.Drawing.Common/src/misc/GDI/DeviceContext.cs b/src/libraries/System.Drawing.Common/src/misc/GDI/DeviceContext.cs index 5ca8b91b9c5c8..b64f7c40b0f37 100644 --- a/src/libraries/System.Drawing.Common/src/misc/GDI/DeviceContext.cs +++ b/src/libraries/System.Drawing.Common/src/misc/GDI/DeviceContext.cs @@ -342,7 +342,7 @@ public override bool Equals(object? obj) /// public override int GetHashCode() => _hDC.GetHashCode(); - internal class GraphicsState + internal sealed class GraphicsState { internal IntPtr hBrush; internal IntPtr hFont; diff --git a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/SetOfValueComparer.cs b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/SetOfValueComparer.cs index 93750c409a205..e85db7683c930 100644 --- a/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/SetOfValueComparer.cs +++ b/src/libraries/System.Formats.Asn1/src/System/Formats/Asn1/SetOfValueComparer.cs @@ -5,7 +5,7 @@ namespace System.Formats.Asn1 { - internal class SetOfValueComparer : IComparer> + internal sealed class SetOfValueComparer : IComparer> { internal static SetOfValueComparer Instance { get; } = new SetOfValueComparer(); diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/ReadLinesIterator.cs b/src/libraries/System.IO.FileSystem/src/System/IO/ReadLinesIterator.cs index 349526cc8bb8e..cc77c9064a5b6 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/ReadLinesIterator.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/ReadLinesIterator.cs @@ -25,7 +25,7 @@ namespace System.IO // - IEnumerator instances from the same IEnumerable party on the same underlying // reader. // - internal class ReadLinesIterator : Iterator + internal sealed class ReadLinesIterator : Iterator { private readonly string _path; private readonly Encoding _encoding; diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs index 83a60d4ccf914..b5e5a54c56c26 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Unix.cs @@ -6,7 +6,7 @@ namespace System.IO.MemoryMappedFiles { - internal partial class MemoryMappedView + internal sealed partial class MemoryMappedView { public static MemoryMappedView CreateView( SafeMemoryMappedFileHandle memMappedFileHandle, MemoryMappedFileAccess access, diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs index 01117ab6960bc..cc3300c12c9fe 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.Windows.cs @@ -8,7 +8,7 @@ namespace System.IO.MemoryMappedFiles { - internal partial class MemoryMappedView + internal sealed partial class MemoryMappedView { // These control the retry behaviour when lock violation errors occur during Flush: private const int MaxFlushWaits = 15; // must be <=30 diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs index 32730cb04b9de..84905632e61ab 100644 --- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs +++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedView.cs @@ -6,7 +6,7 @@ namespace System.IO.MemoryMappedFiles { - internal partial class MemoryMappedView : IDisposable + internal sealed partial class MemoryMappedView : IDisposable { private readonly SafeMemoryMappedViewHandle _viewHandle; private readonly long _pointerOffset; @@ -43,7 +43,7 @@ public MemoryMappedFileAccess Access get { return _access; } } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (!_viewHandle.IsClosed) { diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs index df36d6818e685..4713d8f3497aa 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/InternalRelationshipCollection.cs @@ -25,7 +25,7 @@ namespace System.IO.Packaging /// /// Collection of all the relationships corresponding to a given source PackagePart /// - internal class InternalRelationshipCollection : IEnumerable + internal sealed class InternalRelationshipCollection : IEnumerable { // Mono will parse a URI starting with '/' as an absolute URI, while .NET Core and // .NET Framework will parse this as relative. This will break internal relationships diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/OrderedDictionary.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/OrderedDictionary.cs index 0f17bb5596d06..37cf8b27714b0 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/OrderedDictionary.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/OrderedDictionary.cs @@ -12,7 +12,7 @@ namespace System.IO.Packaging /// This is similar to , but the items will not be sorted by a comparer but rather retain the /// order in which they were added while still retaining good lookup, insertion, and removal. /// - internal class OrderedDictionary : IEnumerable where TKey : notnull + internal sealed class OrderedDictionary : IEnumerable where TKey : notnull { private readonly Dictionary> _dictionary; private readonly LinkedList _order; diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs index aaf4ecddef6ba..f4ed524180ef1 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/PartBasedPackageProperties.cs @@ -22,7 +22,7 @@ namespace System.IO.Packaging /// Setting a property to null deletes this property. 'null' is never strictly speaking /// a property value, but an absence indicator. /// - internal class PartBasedPackageProperties : PackageProperties + internal sealed class PartBasedPackageProperties : PackageProperties { #region Constructors diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipStreamManager.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipStreamManager.cs index e04d3cf1173a7..387819ece7a53 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipStreamManager.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipStreamManager.cs @@ -9,7 +9,7 @@ namespace System.IO.Packaging { - internal class ZipStreamManager : IDisposable + internal sealed class ZipStreamManager : IDisposable { private readonly ZipArchive _zipArchive; private readonly FileAccess _packageFileAccess; @@ -100,7 +100,7 @@ public void Dispose() } // Protected implementation of Dispose pattern. - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (_disposed) return; diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs index a5dd341eb7d5b..4b2df41a9838d 100644 --- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs +++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ZipWrappingStream.cs @@ -10,7 +10,7 @@ namespace System.IO.Packaging { - internal class ZipWrappingStream : Stream + internal sealed class ZipWrappingStream : Stream { private readonly Stream _baseStream; private readonly ZipArchiveEntry _zipArchiveEntry; diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs index 0297ca8888392..2ab3696546621 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeReader.cs @@ -8,7 +8,7 @@ namespace System.IO.Pipelines { - internal class StreamPipeReader : PipeReader + internal sealed class StreamPipeReader : PipeReader { internal const int InitialSegmentPoolSize = 4; // 16K internal const int MaxSegmentPoolSize = 256; // 1MB diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs index 3da5affdbc92d..80c4d77388d4e 100644 --- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs +++ b/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamPipeWriter.cs @@ -8,7 +8,7 @@ namespace System.IO.Pipelines { - internal class StreamPipeWriter : PipeWriter + internal sealed class StreamPipeWriter : PipeWriter { internal const int InitialSegmentPoolSize = 4; // 16K internal const int MaxSegmentPoolSize = 256; // 1MB diff --git a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs index 8168691c9a93f..a6ed15e1cd379 100644 --- a/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs +++ b/src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeServerStream.Windows.cs @@ -277,7 +277,7 @@ private static void RevertImpersonationOnBackout(object? helper, bool exceptionT } } - internal class ExecuteHelper + internal sealed class ExecuteHelper { internal PipeStreamImpersonationWorker _userCode; internal SafePipeHandle? _handle; diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs index 1f3439e380562..8451677a1b0d7 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ExpandoClass.cs @@ -10,7 +10,7 @@ namespace System.Dynamic /// members will share the same class. Classes are dynamically assigned as the /// expando object gains members. /// - internal class ExpandoClass + internal sealed class ExpandoClass { private readonly string[] _keys; // list of names associated with each element in the data array, sorted private readonly int _hashCode; // pre-calculated hash code of all the keys the class contains diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs index 1b01c8be82666..bccac308a0133 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BinaryExpression.cs @@ -493,7 +493,7 @@ public static AssignBinaryExpression Make(Expression left, Expression right, boo public sealed override ExpressionType NodeType => ExpressionType.Assign; } - internal class ByRefAssignBinaryExpression : AssignBinaryExpression + internal sealed class ByRefAssignBinaryExpression : AssignBinaryExpression { internal ByRefAssignBinaryExpression(Expression left, Expression right) : base(left, right) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BlockExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BlockExpression.cs index c8f12524bead5..4d6b22ec6fe73 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BlockExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/BlockExpression.cs @@ -676,7 +676,7 @@ internal override BlockExpression Rewrite(ReadOnlyCollection - internal class BlockExpressionList : IList + internal sealed class BlockExpressionList : IList { private readonly BlockExpression _block; private readonly Expression _arg0; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs index 8a359790b890b..6e6a915e76e98 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs @@ -57,7 +57,7 @@ internal static TypeInfo GetNextTypeInfo(Type initialArg, TypeInfo curTypeInfo) private const int MaximumArity = 17; - internal class TypeInfo + internal sealed class TypeInfo { public Type DelegateType; public Dictionary TypeChain; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Address.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Address.cs index f0587cfd6df51..55dca2cc9c29e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Address.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Address.cs @@ -8,7 +8,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { private void EmitAddress(Expression node, Type type) { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs index 5101d8dbdeded..a888be0831e21 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Binary.cs @@ -9,7 +9,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { private void EmitBinaryExpression(Expression expr) { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs index 3e6033504fa84..72818567876c9 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.ControlFlow.cs @@ -8,7 +8,7 @@ namespace System.Linq.Expressions.Compiler { // The part of the LambdaCompiler dealing with low level control flow // break, continue, return, exceptions, etc - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { private LabelInfo EnsureLabel(LabelTarget node) { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs index 3a1e236cc0e6e..a3049f80d4927 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Expressions.cs @@ -12,7 +12,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { [Flags] internal enum CompilationFlags diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Lambda.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Lambda.cs index 65b987c456502..336e93318e1f0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Lambda.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Lambda.cs @@ -12,7 +12,7 @@ namespace System.Linq.Expressions.Compiler /// Dynamic Language Runtime Compiler. /// This part compiles lambdas. /// - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { #if FEATURE_COMPILE_TO_METHODBUILDER private static int s_counter; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs index b20bff1306921..31008c476e45f 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Logical.cs @@ -8,7 +8,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { #region Conditional diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs index d9d6f4f9a64d3..321a38f8a069e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs @@ -13,7 +13,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { private void EmitBlockExpression(Expression expr, CompilationFlags flags) { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs index e84391a741499..f487d73d7c3f2 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Unary.cs @@ -9,7 +9,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class LambdaCompiler + internal sealed partial class LambdaCompiler { private void EmitQuoteUnaryExpression(Expression expr) { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Bindings.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Bindings.cs index 5f6c20e7ee7f0..1d1abb5982090 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Bindings.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Bindings.cs @@ -8,7 +8,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class StackSpiller + internal sealed partial class StackSpiller { private abstract class BindingRewriter { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.ChildRewriter.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.ChildRewriter.cs index be140e2748e96..d8d978dd47c21 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.ChildRewriter.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.ChildRewriter.cs @@ -9,7 +9,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class StackSpiller + internal sealed partial class StackSpiller { /// /// Rewrites child expressions, spilling them into temps if needed. The diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs index 703c00425f5a8..b1bd1f3dc6fc6 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Generated.cs @@ -3,7 +3,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class StackSpiller + internal sealed partial class StackSpiller { private readonly StackGuard _guard = new StackGuard(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.SpilledExpressionBlock.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.SpilledExpressionBlock.cs index b0ade4f5c7a18..99a3ed5456a0c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.SpilledExpressionBlock.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.SpilledExpressionBlock.cs @@ -8,7 +8,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class StackSpiller + internal sealed partial class StackSpiller { /// /// Creates a special block that is marked as not allowing jumps in. diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs index 41222f5af4d05..d19ba67a7c111 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs @@ -7,7 +7,7 @@ namespace System.Linq.Expressions.Compiler { - internal partial class StackSpiller + internal sealed partial class StackSpiller { /// /// The source of temporary variables introduced during stack spilling. diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ConstantExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ConstantExpression.cs index 515c41c23c8d0..e4adc598570bd 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ConstantExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ConstantExpression.cs @@ -55,7 +55,7 @@ protected internal override Expression Accept(ExpressionVisitor visitor) } } - internal class TypedConstantExpression : ConstantExpression + internal sealed class TypedConstantExpression : ConstantExpression { internal TypedConstantExpression(object? value, Type type) : base(value) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs index 030c02e50676b..2081496c1b399 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs @@ -512,7 +512,7 @@ internal override DynamicExpression Rewrite(Expression[] args) } } - internal class TypedDynamicExpressionN : DynamicExpressionN + internal sealed class TypedDynamicExpressionN : DynamicExpressionN { internal TypedDynamicExpressionN(Type returnType, Type delegateType, CallSiteBinder binder, IReadOnlyList arguments) : base(delegateType, binder, arguments) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.DebuggerProxy.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.DebuggerProxy.cs index c322284dde577..85064e7249a89 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.DebuggerProxy.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.DebuggerProxy.cs @@ -9,7 +9,7 @@ namespace System.Linq.Expressions { public partial class Expression { - internal class BinaryExpressionProxy + internal sealed class BinaryExpressionProxy { private readonly BinaryExpression _node; @@ -31,7 +31,7 @@ public BinaryExpressionProxy(BinaryExpression node) public Type Type => _node.Type; } - internal class BlockExpressionProxy + internal sealed class BlockExpressionProxy { private readonly BlockExpression _node; @@ -50,7 +50,7 @@ public BlockExpressionProxy(BlockExpression node) public ReadOnlyCollection Variables => _node.Variables; } - internal class CatchBlockProxy + internal sealed class CatchBlockProxy { private readonly CatchBlock _node; @@ -66,7 +66,7 @@ public CatchBlockProxy(CatchBlock node) public ParameterExpression? Variable => _node.Variable; } - internal class ConditionalExpressionProxy + internal sealed class ConditionalExpressionProxy { private readonly ConditionalExpression _node; @@ -85,7 +85,7 @@ public ConditionalExpressionProxy(ConditionalExpression node) public Type Type => _node.Type; } - internal class ConstantExpressionProxy + internal sealed class ConstantExpressionProxy { private readonly ConstantExpression _node; @@ -102,7 +102,7 @@ public ConstantExpressionProxy(ConstantExpression node) public object? Value => _node.Value; } - internal class DebugInfoExpressionProxy + internal sealed class DebugInfoExpressionProxy { private readonly DebugInfoExpression _node; @@ -124,7 +124,7 @@ public DebugInfoExpressionProxy(DebugInfoExpression node) public Type Type => _node.Type; } - internal class DefaultExpressionProxy + internal sealed class DefaultExpressionProxy { private readonly DefaultExpression _node; @@ -140,7 +140,7 @@ public DefaultExpressionProxy(DefaultExpression node) public Type Type => _node.Type; } - internal class GotoExpressionProxy + internal sealed class GotoExpressionProxy { private readonly GotoExpression _node; @@ -159,7 +159,7 @@ public GotoExpressionProxy(GotoExpression node) public Expression? Value => _node.Value; } - internal class IndexExpressionProxy + internal sealed class IndexExpressionProxy { private readonly IndexExpression _node; @@ -178,7 +178,7 @@ public IndexExpressionProxy(IndexExpression node) public Type Type => _node.Type; } - internal class InvocationExpressionProxy + internal sealed class InvocationExpressionProxy { private readonly InvocationExpression _node; @@ -196,7 +196,7 @@ public InvocationExpressionProxy(InvocationExpression node) public Type Type => _node.Type; } - internal class LabelExpressionProxy + internal sealed class LabelExpressionProxy { private readonly LabelExpression _node; @@ -214,7 +214,7 @@ public LabelExpressionProxy(LabelExpression node) public Type Type => _node.Type; } - internal class LambdaExpressionProxy + internal sealed class LambdaExpressionProxy { private readonly LambdaExpression _node; @@ -235,7 +235,7 @@ public LambdaExpressionProxy(LambdaExpression node) public Type Type => _node.Type; } - internal class ListInitExpressionProxy + internal sealed class ListInitExpressionProxy { private readonly ListInitExpression _node; @@ -253,7 +253,7 @@ public ListInitExpressionProxy(ListInitExpression node) public Type Type => _node.Type; } - internal class LoopExpressionProxy + internal sealed class LoopExpressionProxy { private readonly LoopExpression _node; @@ -272,7 +272,7 @@ public LoopExpressionProxy(LoopExpression node) public Type Type => _node.Type; } - internal class MemberExpressionProxy + internal sealed class MemberExpressionProxy { private readonly MemberExpression _node; @@ -290,7 +290,7 @@ public MemberExpressionProxy(MemberExpression node) public Type Type => _node.Type; } - internal class MemberInitExpressionProxy + internal sealed class MemberInitExpressionProxy { private readonly MemberInitExpression _node; @@ -308,7 +308,7 @@ public MemberInitExpressionProxy(MemberInitExpression node) public Type Type => _node.Type; } - internal class MethodCallExpressionProxy + internal sealed class MethodCallExpressionProxy { private readonly MethodCallExpression _node; @@ -327,7 +327,7 @@ public MethodCallExpressionProxy(MethodCallExpression node) public Type Type => _node.Type; } - internal class NewArrayExpressionProxy + internal sealed class NewArrayExpressionProxy { private readonly NewArrayExpression _node; @@ -344,7 +344,7 @@ public NewArrayExpressionProxy(NewArrayExpression node) public Type Type => _node.Type; } - internal class NewExpressionProxy + internal sealed class NewExpressionProxy { private readonly NewExpression _node; @@ -363,7 +363,7 @@ public NewExpressionProxy(NewExpression node) public Type Type => _node.Type; } - internal class ParameterExpressionProxy + internal sealed class ParameterExpressionProxy { private readonly ParameterExpression _node; @@ -381,7 +381,7 @@ public ParameterExpressionProxy(ParameterExpression node) public Type Type => _node.Type; } - internal class RuntimeVariablesExpressionProxy + internal sealed class RuntimeVariablesExpressionProxy { private readonly RuntimeVariablesExpression _node; @@ -398,7 +398,7 @@ public RuntimeVariablesExpressionProxy(RuntimeVariablesExpression node) public ReadOnlyCollection Variables => _node.Variables; } - internal class SwitchCaseProxy + internal sealed class SwitchCaseProxy { private readonly SwitchCase _node; @@ -412,7 +412,7 @@ public SwitchCaseProxy(SwitchCase node) public ReadOnlyCollection TestValues => _node.TestValues; } - internal class SwitchExpressionProxy + internal sealed class SwitchExpressionProxy { private readonly SwitchExpression _node; @@ -432,7 +432,7 @@ public SwitchExpressionProxy(SwitchExpression node) public Type Type => _node.Type; } - internal class TryExpressionProxy + internal sealed class TryExpressionProxy { private readonly TryExpression _node; @@ -452,7 +452,7 @@ public TryExpressionProxy(TryExpression node) public Type Type => _node.Type; } - internal class TypeBinaryExpressionProxy + internal sealed class TypeBinaryExpressionProxy { private readonly TypeBinaryExpression _node; @@ -470,7 +470,7 @@ public TypeBinaryExpressionProxy(TypeBinaryExpression node) public Type TypeOperand => _node.TypeOperand; } - internal class UnaryExpressionProxy + internal sealed class UnaryExpressionProxy { private readonly UnaryExpression _node; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs index 103d1cfc5d2d9..f10233360deb0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs @@ -387,7 +387,7 @@ public override int Run(InterpretedFrame frame) public override string ToString() => "Call(" + _target + ")"; } - internal class ByRefMethodInfoCallInstruction : MethodInfoCallInstruction + internal sealed class ByRefMethodInfoCallInstruction : MethodInfoCallInstruction { private readonly ByRefUpdater[] _byrefArgs; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ControlFlowInstructions.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ControlFlowInstructions.cs index dc058e63c469f..194af7be42011 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ControlFlowInstructions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/ControlFlowInstructions.cs @@ -142,7 +142,7 @@ public override int Run(InterpretedFrame frame) } } - internal class BranchInstruction : OffsetInstruction + internal sealed class BranchInstruction : OffsetInstruction { private static Instruction[][][]? s_caches; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs index 680f9040899ba..966007da35ab2 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs @@ -67,7 +67,7 @@ public override int Run(InterpretedFrame frame) public override string ToString() => "New " + _constructor.DeclaringType!.Name + "(" + _constructor + ")"; } - internal class ByRefNewInstruction : NewInstruction + internal sealed class ByRefNewInstruction : NewInstruction { private readonly ByRefUpdater[] _byrefArgs; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs index 6f429ea1af398..e802855f6bf81 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs @@ -167,7 +167,7 @@ public static void UnwrapAndRethrow(TargetInvocationException exception) /// /// A hybrid dictionary which compares based upon object identity. /// - internal class HybridReferenceDictionary where TKey : class + internal sealed class HybridReferenceDictionary where TKey : class { private KeyValuePair[]? _keysAndValues; private Dictionary? _dict; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs index d4e21e184902a..3d675df1796a4 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs @@ -19,7 +19,7 @@ namespace System.Linq.Parallel /// implementations that always and consistently yield no elements. /// /// - internal class EmptyEnumerable : ParallelQuery + internal sealed class EmptyEnumerable : ParallelQuery { private EmptyEnumerable() : base(QuerySettings.Empty) diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs index d92798f4ac999..88f559afe1127 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs @@ -19,7 +19,7 @@ namespace System.Linq.Parallel /// a weakly typed IEnumerable object, allowing it to be accessed as a strongly typed /// IEnumerable{object}. /// - internal class EnumerableWrapperWeakToStrong : IEnumerable + internal sealed class EnumerableWrapperWeakToStrong : IEnumerable { private readonly IEnumerable _wrappedEnumerable; // The wrapped enumerable object. @@ -35,7 +35,7 @@ internal EnumerableWrapperWeakToStrong(IEnumerable wrappedEnumerable) IEnumerator IEnumerable.GetEnumerator() { - return ((IEnumerable)this).GetEnumerator(); + return ((IEnumerable)this).GetEnumerator(); } public IEnumerator GetEnumerator() diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs index 3184d6b3ee2b8..861c1c6dac627 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs @@ -17,7 +17,7 @@ namespace System.Linq.Parallel /// A simple implementation of the ParallelQuery{object} interface which wraps an /// underlying IEnumerable, such that it can be used in parallel queries. /// - internal class ParallelEnumerableWrapper : ParallelQuery + internal sealed class ParallelEnumerableWrapper : ParallelQuery { private readonly IEnumerable _source; // The wrapped enumerable object. @@ -48,7 +48,7 @@ internal override IEnumerator GetEnumeratorUntyped() /// underlying IEnumerable{T}, such that it can be used in parallel queries. /// /// - internal class ParallelEnumerableWrapper : ParallelQuery + internal sealed class ParallelEnumerableWrapper : ParallelQuery { private readonly IEnumerable _wrappedEnumerable; // The wrapped enumerable object. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RangeEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RangeEnumerable.cs index ef1ff37022911..5e5413d2e9ed0 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RangeEnumerable.cs @@ -15,7 +15,7 @@ namespace System.Linq.Parallel /// A simple enumerable type that implements the range algorithm. It also supports /// partitioning of the indices by implementing an interface that PLINQ recognizes. /// - internal class RangeEnumerable : ParallelQuery, IParallelPartitionable + internal sealed class RangeEnumerable : ParallelQuery, IParallelPartitionable { private readonly int _from; // Lowest index to include. private readonly int _count; // Number of indices to include. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs index 7fa5ef730d6f2..c56de6ca561cf 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs @@ -18,7 +18,7 @@ namespace System.Linq.Parallel /// partitioning of the count space by implementing an interface that PLINQ recognizes. /// /// - internal class RepeatEnumerable : ParallelQuery, IParallelPartitionable + internal sealed class RepeatEnumerable : ParallelQuery, IParallelPartitionable { private readonly TResult _element; // Element value to repeat. private readonly int _count; // Count of element values. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/ArrayMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/ArrayMergeHelper.cs index d9dbce59a5413..1be7789b710d1 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/ArrayMergeHelper.cs @@ -25,7 +25,7 @@ namespace System.Linq.Parallel /// no extra cost for ordering. /// /// - internal class ArrayMergeHelper : IMergeHelper + internal sealed class ArrayMergeHelper : IMergeHelper { private readonly QueryResults _queryResults; // Indexable query results private readonly TInputOutput[] _outputArray; // The output array. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs index 3c95f227d448b..c318b3b5954e0 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/DefaultMergeHelper.cs @@ -23,7 +23,7 @@ namespace System.Linq.Parallel /// /// /// - internal class DefaultMergeHelper : IMergeHelper + internal sealed class DefaultMergeHelper : IMergeHelper { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. private readonly PartitionedStream _partitions; // Source partitions. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs index 160509eba2f5d..984ae2f014a28 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/MergeExecutor.cs @@ -23,7 +23,7 @@ namespace System.Linq.Parallel /// order preserving merge, and so forth. /// /// - internal class MergeExecutor : IEnumerable + internal sealed class MergeExecutor : IEnumerable { // Many internal algorithms are parameterized based on the data. The IMergeHelper // is the pluggable interface whose implementations perform those algorithms. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs index eb12e17e2f22a..e79ed5116f594 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs @@ -20,7 +20,7 @@ namespace System.Linq.Parallel /// /// /// - internal class OrderPreservingMergeHelper : IMergeHelper + internal sealed class OrderPreservingMergeHelper : IMergeHelper { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. private readonly PartitionedStream _partitions; // Source partitions. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs index 46ab22ac16ca0..4153cf39a875c 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs @@ -36,7 +36,7 @@ namespace System.Linq.Parallel /// Finally, if the producer notices that its buffer has exceeded an even greater threshold, it will /// go to sleep and wait until the consumer takes the entire buffer. /// - internal class OrderPreservingPipeliningMergeHelper : IMergeHelper + internal sealed class OrderPreservingPipeliningMergeHelper : IMergeHelper { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. private readonly PartitionedStream _partitions; // Source partitions. @@ -134,7 +134,7 @@ internal OrderPreservingPipeliningMergeHelper( if (keyComparer == Util.GetDefaultComparer()) { Debug.Assert(typeof(TKey) == typeof(int)); - _producerComparer = (IComparer>)new ProducerComparerInt(); + _producerComparer = (IComparer>)(object)ProducerComparerInt.Instance; } else { @@ -513,8 +513,12 @@ internal Producer(TKey maxKey, int producerIndex) /// x.MaxKey EQUALS y.MaxKey => x EQUALS y => return 0 /// x.MaxKey LESS_THAN y.MaxKey => x GREATER_THAN y => return + /// - internal class ProducerComparerInt : IComparer> + internal sealed class ProducerComparerInt : IComparer> { + public static readonly ProducerComparerInt Instance = new ProducerComparerInt(); + + private ProducerComparerInt() { } + public int Compare(Producer x, Producer y) { Debug.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs index 85f2dd2ccb018..f31478546b680 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs @@ -21,7 +21,7 @@ namespace System.Linq.Parallel /// The kind of elements. /// The key used to distribute elements. /// The kind of keys found in the source (ignored). - internal class HashRepartitionEnumerator : QueryOperatorEnumerator, int> + internal sealed class HashRepartitionEnumerator : QueryOperatorEnumerator, int> { private const int ENUMERATION_NOT_STARTED = -1; // Sentinel to note we haven't begun enumerating yet. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs index a911d587bf711..deca18ddb02a4 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs @@ -22,7 +22,7 @@ namespace System.Linq.Parallel /// The kind of elements. /// The key used to distribute elements. /// The kind of keys found in the source. - internal class OrderedHashRepartitionEnumerator : QueryOperatorEnumerator, TOrderKey> + internal sealed class OrderedHashRepartitionEnumerator : QueryOperatorEnumerator, TOrderKey> { private const int ENUMERATION_NOT_STARTED = -1; // Sentinel to note we haven't begun enumerating yet. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs index 105164330d02d..a598f1ebbd80c 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs @@ -12,7 +12,7 @@ namespace System.Linq.Parallel { - internal class OrderedHashRepartitionStream : HashRepartitionStream + internal sealed class OrderedHashRepartitionStream : HashRepartitionStream { internal OrderedHashRepartitionStream( PartitionedStream inputStream, Func? hashKeySelector, diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs index e831e435704d0..1d43e57759141 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs @@ -43,7 +43,7 @@ namespace System.Linq.Parallel /// This is used as the default partitioning strategy by much of the PLINQ infrastructure. /// /// - internal class PartitionedDataSource : PartitionedStream + internal sealed class PartitionedDataSource : PartitionedStream { //--------------------------------------------------------------------------------------- // Just constructs a new partition stream. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs index 7089002414ec4..ab9a6096869ad 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs @@ -12,7 +12,7 @@ namespace System.Linq.Parallel { - internal class UnorderedHashRepartitionStream : HashRepartitionStream + internal sealed class UnorderedHashRepartitionStream : HashRepartitionStream { //--------------------------------------------------------------------------------------- // Creates a new partition exchange operator. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs index 98ad8db72ab71..7c07b51b24e2d 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs @@ -214,7 +214,7 @@ internal override bool LimitsParallelism /// /// /// - internal class GroupJoinHashLookupBuilder : HashLookupBuilder, int, THashKey> + internal sealed class GroupJoinHashLookupBuilder : HashLookupBuilder, int, THashKey> { private readonly QueryOperatorEnumerator, TOrderKey> _dataSource; // data source. For building. private readonly IEqualityComparer? _keyComparer; // An optional key comparison object. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs index 4100a8d4814ef..43dce156cf817 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs @@ -35,7 +35,7 @@ namespace System.Linq.Parallel /// /// /// - internal class HashJoinQueryOperatorEnumerator + internal sealed class HashJoinQueryOperatorEnumerator : QueryOperatorEnumerator { private readonly QueryOperatorEnumerator, TLeftKey> _leftSource; // Left (outer) data source. For probing. @@ -200,7 +200,7 @@ internal abstract class HashJoinOutputKeyBuilder /// /// - internal class LeftKeyOutputKeyBuilder : HashJoinOutputKeyBuilder + internal sealed class LeftKeyOutputKeyBuilder : HashJoinOutputKeyBuilder { public override TLeftKey Combine(TLeftKey leftKey, TRightKey rightKey) { @@ -215,7 +215,7 @@ public override TLeftKey Combine(TLeftKey leftKey, TRightKey rightKey) /// /// /// - internal class PairOutputKeyBuilder : HashJoinOutputKeyBuilder> + internal sealed class PairOutputKeyBuilder : HashJoinOutputKeyBuilder> { public override Pair Combine(TLeftKey leftKey, TRightKey rightKey) { diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs index 4a9fa958d65fd..b603375af3273 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs @@ -191,7 +191,7 @@ internal override bool LimitsParallelism /// /// /// - internal class JoinHashLookupBuilder : HashLookupBuilder + internal sealed class JoinHashLookupBuilder : HashLookupBuilder { private readonly QueryOperatorEnumerator, TOrderKey> _dataSource; // data source. For building. private readonly IEqualityComparer? _keyComparer; // An optional key comparison object. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs index 62d3ce0e6be73..3a170f0d72c40 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs @@ -159,7 +159,7 @@ internal override bool LimitsParallelism // QueryResults are indexable. // - internal class ZipQueryOperatorResults : QueryResults + internal sealed class ZipQueryOperatorResults : QueryResults { private readonly QueryResults _leftChildResults; private readonly QueryResults _rightChildResults; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/ListQueryResults.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/ListQueryResults.cs index 78a20d6dc0def..02eb817eb4f87 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/ListQueryResults.cs @@ -15,7 +15,7 @@ namespace System.Linq.Parallel /// Class to represent an IList{T} as QueryResults{T} /// /// - internal class ListQueryResults : QueryResults + internal sealed class ListQueryResults : QueryResults { private readonly IList _source; private readonly int _partitionCount; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs index c4764e30772aa..37467935b1e77 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs @@ -16,7 +16,7 @@ namespace System.Linq.Parallel /// Represents operators that set various query execution options. /// /// - internal class QueryExecutionOption : QueryOperator + internal sealed class QueryExecutionOption : QueryOperator { private readonly QueryOperator _child; private readonly OrdinalIndexState _indexState; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs index 2a4632720f0fb..65275582d630a 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs @@ -15,7 +15,7 @@ namespace System.Linq.Parallel /// /// Partitioned stream recipient that will merge the results. /// - internal class PartitionedStreamMerger : IPartitionedStreamRecipient + internal sealed class PartitionedStreamMerger : IPartitionedStreamRecipient { private readonly bool _forEffectMerge; private readonly ParallelMergeOptions _mergeOptions; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs index e74162b1f5e79..9ea85ac61d933 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs @@ -22,7 +22,7 @@ namespace System.Linq.Parallel /// /// A QueryOperator that represents the output of the query partitioner.AsParallel(). /// - internal class PartitionerQueryOperator : QueryOperator + internal sealed class PartitionerQueryOperator : QueryOperator { private readonly Partitioner _partitioner; // The partitioner to use as data source. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs index edf520c91901f..b85e3fb3a30ed 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs @@ -20,7 +20,7 @@ namespace System.Linq.Parallel /// lazily because once GetOpenedEnumerator() is called, PLINQ starts precomputing the /// results of the query. /// - internal class QueryOpeningEnumerator : IEnumerator + internal sealed class QueryOpeningEnumerator : IEnumerator { private readonly QueryOperator _queryOperator; private IEnumerator? _openedQueryEnumerator; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs index 109f9e2706072..09910614a5988 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs @@ -676,7 +676,7 @@ protected override HashLookup, GroupKeyData> BuildHashLookup( // key-to-many-values mapping. // - internal class GroupByGrouping : IGrouping + internal sealed class GroupByGrouping : IGrouping { private readonly KeyValuePair, ListChunk> _keyValues; // A key value pair. @@ -722,7 +722,7 @@ IEnumerator IEnumerable.GetEnumerator() /// An ordered version of the grouping data structure. Represents an ordered group of elements that /// have the same grouping key. /// - internal class OrderedGroupByGrouping : IGrouping + internal sealed class OrderedGroupByGrouping : IGrouping { private const int INITIAL_CHUNK_SIZE = 2; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs index 32d41e53c7a6a..be679efe9d760 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs @@ -124,9 +124,9 @@ internal override bool LimitsParallelism } } - internal class SortQueryOperatorResults : QueryResults + internal sealed class SortQueryOperatorResults : QueryResults { - protected QueryResults _childQueryResults; // Results of the child query + private QueryResults _childQueryResults; // Results of the child query private readonly SortQueryOperator _op; // Operator that generated these results private QuerySettings _settings; // Settings collected from the query @@ -173,7 +173,7 @@ public void Receive(PartitionedStream childPartitioned // This enumerator performs sorting based on a key selection and comparison routine. // - internal class SortQueryOperatorEnumerator : QueryOperatorEnumerator + internal sealed class SortQueryOperatorEnumerator : QueryOperatorEnumerator { private readonly QueryOperatorEnumerator? _source; // Data source to sort. private readonly Func _keySelector; // Key selector used when sorting. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/CancellationState.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/CancellationState.cs index dd72fc42513f1..9c102eb2db541 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/CancellationState.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/CancellationState.cs @@ -15,7 +15,7 @@ namespace System.Linq.Parallel { - internal class CancellationState + internal sealed class CancellationState { // a cancellation signal that can be set internally to prompt early query termination. internal CancellationTokenSource? InternalCancellationTokenSource; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs index 81439fee3b01b..ccac54907c319 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs @@ -18,7 +18,7 @@ namespace System.Linq.Parallel { - internal class OrderPreservingPipeliningSpoolingTask : SpoolingTaskBase + internal sealed class OrderPreservingPipeliningSpoolingTask : SpoolingTaskBase { private readonly QueryTaskGroupState _taskGroupState; // State shared among tasks. private readonly QueryOperatorEnumerator _partition; // The source partition. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs index 87180c39f0419..36d0645dc293f 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs @@ -22,7 +22,7 @@ namespace System.Linq.Parallel /// /// /// - internal class OrderPreservingSpoolingTask : SpoolingTaskBase + internal sealed class OrderPreservingSpoolingTask : SpoolingTaskBase { private readonly Shared _results; // The destination array cell into which data is placed. private readonly SortHelper _sortHelper; // A helper that performs the sorting. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs index 23a9b8ba7ec3d..859c74931749e 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs @@ -19,7 +19,7 @@ namespace System.Linq.Parallel /// convenient methods for tracing significant ETW events, waiting on tasks, propagating /// exceptions, and performing cancellation activities. /// - internal class QueryTaskGroupState + internal sealed class QueryTaskGroupState { private Task? _rootTask; // The task under which all query tasks root. private int _alreadyEnded; // Whether the tasks have been waited on already. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs index e1f8703a16180..440be3d9f9ce0 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Scheduling/SpoolingTask.cs @@ -175,7 +175,7 @@ internal static void SpoolForAll( /// /// /// - internal class StopAndGoSpoolingTask : SpoolingTaskBase + internal sealed class StopAndGoSpoolingTask : SpoolingTaskBase { // The data source from which to pull data. private readonly QueryOperatorEnumerator _source; @@ -264,7 +264,7 @@ protected override void SpoolingFinally() /// /// /// - internal class PipelineSpoolingTask : SpoolingTaskBase + internal sealed class PipelineSpoolingTask : SpoolingTaskBase { // The data source from which to pull data. private readonly QueryOperatorEnumerator _source; @@ -355,7 +355,7 @@ protected override void SpoolingFinally() /// /// /// - internal class ForAllSpoolingTask : SpoolingTaskBase + internal sealed class ForAllSpoolingTask : SpoolingTaskBase { // The data source from which to pull data. private readonly QueryOperatorEnumerator _source; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/FixedMaxHeap.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/FixedMaxHeap.cs index 80d596c6dcd06..0e66a2e4d601b 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/FixedMaxHeap.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/FixedMaxHeap.cs @@ -16,7 +16,7 @@ namespace System.Linq.Parallel /// Very simple heap data structure, of fixed size. /// /// - internal class FixedMaxHeap + internal sealed class FixedMaxHeap { private readonly TElement[] _elements; // Element array. private int _count; // Current count. diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/GrowingArray.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/GrowingArray.cs index 6c9dc42994e9a..d0b245910a7d8 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/GrowingArray.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/GrowingArray.cs @@ -15,7 +15,7 @@ namespace System.Linq.Parallel /// A growing array. Unlike List{T}, it makes the internal array available to its user. /// /// - internal class GrowingArray + internal sealed class GrowingArray { private T[] _array; private int _count; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs index 32064cec4acf4..fae7beb9589b4 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs @@ -17,7 +17,7 @@ namespace System.Linq.Parallel /// /// The kind of keys contained within. /// The kind of values contained within. - internal class HashLookup + internal sealed class HashLookup { private int[] buckets; private Slot[] slots; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/IntValueEvent.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/IntValueEvent.cs index 831e00ee8eb57..6f0eee4f6963a 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/IntValueEvent.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/IntValueEvent.cs @@ -12,7 +12,7 @@ namespace System.Linq.Parallel /// /// A ManualResetEventSlim that also remembers a value that was stored at the last Set(). /// - internal class IntValueEvent : ManualResetEventSlim + internal sealed class IntValueEvent : ManualResetEventSlim { internal int Value; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ListChunk.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ListChunk.cs index 5e2c43b675cf8..98e8aa299f8bd 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ListChunk.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ListChunk.cs @@ -16,7 +16,7 @@ namespace System.Linq.Parallel /// A linked list of array chunks. Allows direct access to its arrays. /// /// The elements held within. - internal class ListChunk : IEnumerable + internal sealed class ListChunk : IEnumerable { internal TInputOutput[] _chunk; private int _chunkCount; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Lookup.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Lookup.cs index f63fcaa95d917..60fbccd675173 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Lookup.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Lookup.cs @@ -34,7 +34,7 @@ namespace System.Linq.Parallel /// /// /// - internal class Lookup : ILookup where TKey: notnull + internal sealed class Lookup : ILookup where TKey: notnull { private readonly IDictionary> _dict; private readonly IEqualityComparer _comparer; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ReverseComparer.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ReverseComparer.cs index 229b5244acb10..31003137becbb 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ReverseComparer.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/ReverseComparer.cs @@ -17,7 +17,7 @@ namespace System.Linq.Parallel /// opposite answer. /// /// - internal class ReverseComparer : IComparer + internal sealed class ReverseComparer : IComparer { private readonly IComparer _comparer; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Shared.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Shared.cs index c257780fcc95c..0d29b2cec74a4 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Shared.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Shared.cs @@ -13,7 +13,7 @@ namespace System.Linq.Parallel /// A very simple primitive that allows us to share a value across multiple threads. /// /// - internal class Shared + internal sealed class Shared { internal T Value; diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs index b4a22b54be6e6..6461b11a1bb26 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/Sorting.cs @@ -32,7 +32,7 @@ internal abstract class SortHelper internal abstract TInputOutput[] Sort(); } - internal class SortHelper : SortHelper, IDisposable + internal sealed class SortHelper : SortHelper, IDisposable { private readonly QueryOperatorEnumerator _source; // The data source from which to pull data. private readonly int _partitionCount; // The partition count. diff --git a/src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs b/src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs index d4448372c3167..77b07b5b5c3ad 100644 --- a/src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs +++ b/src/libraries/System.Linq.Queryable/src/System/Linq/EnumerableRewriter.cs @@ -11,7 +11,7 @@ namespace System.Linq { - internal class EnumerableRewriter : ExpressionVisitor + internal sealed class EnumerableRewriter : ExpressionVisitor { // We must ensure that if a LabelTarget is rewritten that it is always rewritten to the same new target // or otherwise expressions using it won't match correctly. diff --git a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs index 777b28c916a30..d49da3a5af48f 100644 --- a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs +++ b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs @@ -17,7 +17,7 @@ private abstract partial class AppendPrependIterator : IIListProvider + private sealed partial class AppendPrepend1Iterator { private TSource[] LazyToArray() { @@ -100,7 +100,7 @@ public override int GetCount(bool onlyIfCheap) } } - private partial class AppendPrependN + private sealed partial class AppendPrependN { private TSource[] LazyToArray() { diff --git a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.cs b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.cs index 346cd5c1c06d9..2397fbd39e282 100644 --- a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.cs +++ b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.cs @@ -86,7 +86,7 @@ public override void Dispose() /// Represents the insertion of an item before or after an . /// /// The type of the source enumerable. - private partial class AppendPrepend1Iterator : AppendPrependIterator + private sealed partial class AppendPrepend1Iterator : AppendPrependIterator { private readonly TSource _item; private readonly bool _appending; @@ -165,7 +165,7 @@ public override AppendPrependIterator Prepend(TSource item) /// Represents the insertion of multiple items before or after an . /// /// The type of the source enumerable. - private partial class AppendPrependN : AppendPrependIterator + private sealed partial class AppendPrependN : AppendPrependIterator { private readonly SingleLinkedNode? _prepended; private readonly SingleLinkedNode? _appended; diff --git a/src/libraries/System.Management/ref/System.Management.manual.cs b/src/libraries/System.Management/ref/System.Management.manual.cs index 59dbdc8aeb118..45b594bdb133a 100644 --- a/src/libraries/System.Management/ref/System.Management.manual.cs +++ b/src/libraries/System.Management/ref/System.Management.manual.cs @@ -8,13 +8,13 @@ namespace System.Management { [System.ComponentModel.TypeConverter(typeof(ManagementPathConverter))] public partial class ManagementPath { } - internal class ManagementPathConverter { } + internal sealed class ManagementPathConverter { } [System.ComponentModel.TypeConverter(typeof(ManagementQueryConverter))] public abstract partial class ManagementQuery { } - internal class ManagementQueryConverter { } + internal sealed class ManagementQueryConverter { } [System.ComponentModel.TypeConverter(typeof(ManagementScopeConverter))] public partial class ManagementScope { } - internal class ManagementScopeConverter { } + internal sealed class ManagementScopeConverter { } } diff --git a/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs b/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs index efe3c3e61ce9d..954bfabcd8f55 100644 --- a/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs +++ b/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs @@ -464,7 +464,7 @@ public int EndEnumeration_() } } - internal class MarshalWbemObject : ICustomMarshaler + internal sealed class MarshalWbemObject : ICustomMarshaler { public static ICustomMarshaler GetInstance(string cookie) { @@ -1591,7 +1591,7 @@ private static bool IsWindows2000OrHigher() /// 4. Delegate with parameter and return value. /// /// - internal class ThreadDispatch + internal sealed class ThreadDispatch { #region Private fields private Thread thread; diff --git a/src/libraries/System.Management/src/System/Management/ManagementEventArgs.cs b/src/libraries/System.Management/src/System/Management/ManagementEventArgs.cs index 39a822221713f..b858c1b430c8e 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementEventArgs.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementEventArgs.cs @@ -4,12 +4,12 @@ namespace System.Management { - internal class IdentifierChangedEventArgs : EventArgs + internal sealed class IdentifierChangedEventArgs : EventArgs { internal IdentifierChangedEventArgs() { } } - internal class InternalObjectPutEventArgs : EventArgs + internal sealed class InternalObjectPutEventArgs : EventArgs { private readonly ManagementPath path; diff --git a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs index b7e994e5642c5..3d0a26a575fcd 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs @@ -600,7 +600,7 @@ internal void FireEventArrived(EventArrivedEventArgs args) } - internal class SinkForEventQuery : IWmiEventSource + internal sealed class SinkForEventQuery : IWmiEventSource { private readonly ManagementEventWatcher eventWatcher; private readonly object context; diff --git a/src/libraries/System.Management/src/System/Management/ManagementOperationWatcher.cs b/src/libraries/System.Management/src/System/Management/ManagementOperationWatcher.cs index 94fd1f7fefd79..8aee1046e7496 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementOperationWatcher.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementOperationWatcher.cs @@ -364,7 +364,7 @@ internal void FireObjectPut(ObjectPutEventArgs args) } } - internal class WmiEventState + internal sealed class WmiEventState { private readonly Delegate d; private readonly ManagementEventArgs args; @@ -402,7 +402,7 @@ public AutoResetEvent AutoResetEvent /// WMI event as "done" until all target delegates have signalled that they are /// done. /// - internal class WmiDelegateInvoker + internal sealed class WmiDelegateInvoker { internal object sender; diff --git a/src/libraries/System.Management/src/System/Management/ManagementPath.cs b/src/libraries/System.Management/src/System/Management/ManagementPath.cs index 8bcf9b545a23e..fab177277f276 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementPath.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementPath.cs @@ -1046,7 +1046,7 @@ public bool IsSingleton /// /// Converts a String to a ManagementPath /// - internal class ManagementPathConverter : ExpandableObjectConverter + internal sealed class ManagementPathConverter : ExpandableObjectConverter { /// diff --git a/src/libraries/System.Management/src/System/Management/ManagementQuery.cs b/src/libraries/System.Management/src/System/Management/ManagementQuery.cs index 509b1cfd61df2..f044ab25fe408 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementQuery.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementQuery.cs @@ -3169,7 +3169,7 @@ public override object Clone() /// /// Converts a String to a ManagementQuery /// - internal class ManagementQueryConverter : ExpandableObjectConverter + internal sealed class ManagementQueryConverter : ExpandableObjectConverter { /// diff --git a/src/libraries/System.Management/src/System/Management/ManagementScope.cs b/src/libraries/System.Management/src/System/Management/ManagementScope.cs index 110abe48273b6..a1b10722738e2 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementScope.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementScope.cs @@ -1038,7 +1038,7 @@ internal SecuredIWbemServicesHandler GetSecuredIWbemServicesHandler(IWbemService }//ManagementScope - internal class SecuredIEnumWbemClassObjectHandler + internal sealed class SecuredIEnumWbemClassObjectHandler { private readonly IEnumWbemClassObject pEnumWbemClassObjectsecurityHelper; private readonly ManagementScope scope; @@ -1092,7 +1092,7 @@ internal int Skip_(int lTimeout, uint nCount) } - internal class SecuredConnectHandler + internal sealed class SecuredConnectHandler { private readonly ManagementScope scope; @@ -1142,7 +1142,7 @@ internal int ConnectNSecureIWbemServices(string path, ref IWbemServices pService } } - internal class SecuredIWbemServicesHandler + internal sealed class SecuredIWbemServicesHandler { private readonly IWbemServices pWbemServiecsSecurityHelper; private readonly ManagementScope scope; @@ -1381,7 +1381,7 @@ internal int ExecMethodAsync_(string strObjectPath, string strMethodName, int lF } - internal class SecurityHandler + internal sealed class SecurityHandler { private bool needToReset; private readonly IntPtr handle; @@ -1469,7 +1469,7 @@ internal void SecureIUnknown(object unknown) /// /// Converts a String to a ManagementScope /// - internal class ManagementScopeConverter : ExpandableObjectConverter + internal sealed class ManagementScopeConverter : ExpandableObjectConverter { /// diff --git a/src/libraries/System.Management/src/System/Management/WMIGenerator.cs b/src/libraries/System.Management/src/System/Management/WMIGenerator.cs index c514ddd837068..753b3d8fa12de 100644 --- a/src/libraries/System.Management/src/System/Management/WMIGenerator.cs +++ b/src/libraries/System.Management/src/System/Management/WMIGenerator.cs @@ -43,7 +43,7 @@ public enum CodeLanguage /// /// Used to generate a strongly-typed code class for a given WMI class. /// - internal class ManagementClassGenerator + internal sealed class ManagementClassGenerator { private readonly string VSVERSION = "8.0.0.0"; private string OriginalServer = string.Empty; diff --git a/src/libraries/System.Management/src/System/Management/WmiEventSink.cs b/src/libraries/System.Management/src/System/Management/WmiEventSink.cs index d70cc2c39a1e6..151b16d665a92 100644 --- a/src/libraries/System.Management/src/System/Management/WmiEventSink.cs +++ b/src/libraries/System.Management/src/System/Management/WmiEventSink.cs @@ -235,7 +235,7 @@ internal void ReleaseStub() // Special sink implementation for ManagementObject.Get // Doesn't issue ObjectReady events - internal class WmiGetEventSink : WmiEventSink + internal sealed class WmiGetEventSink : WmiEventSink { private readonly ManagementObject managementObject; diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs index 5407ccdf9b476..f659c9c2f07e2 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpAuthHelper.cs @@ -7,7 +7,7 @@ namespace System.Net.Http { - internal class WinHttpAuthHelper + internal sealed class WinHttpAuthHelper { // Fast lookup table to convert WINHTTP_AUTH constants to strings. // WINHTTP_AUTH_SCHEME_BASIC = 0x00000001; diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpChannelBinding.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpChannelBinding.cs index 67b2f99fcadaf..5e862724d0e7f 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpChannelBinding.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpChannelBinding.cs @@ -10,7 +10,7 @@ namespace System.Net.Http { - internal class WinHttpChannelBinding : ChannelBinding + internal sealed class WinHttpChannelBinding : ChannelBinding { private int _size; private string _cachedToString; diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs index 2afd23a347f76..54fa11b8fea5a 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpException.cs @@ -10,7 +10,7 @@ namespace System.Net.Http { [Serializable] - internal class WinHttpException : Win32Exception + internal sealed class WinHttpException : Win32Exception { public WinHttpException(int error, string message) : base(error, message) { diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTransportContext.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTransportContext.cs index c3b4ddb6f6e76..1c3d5eea71799 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTransportContext.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpTransportContext.cs @@ -8,7 +8,7 @@ namespace System.Net.Http { - internal class WinHttpTransportContext : TransportContext + internal sealed class WinHttpTransportContext : TransportContext { private WinHttpChannelBinding _channelBinding; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs index f6c65298d179a..30fe2d650b64c 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/AltSvcHeaderParser.cs @@ -10,7 +10,7 @@ namespace System.Net.Http.Headers /// /// Parses Alt-Svc header values, per RFC 7838 Section 3. /// - internal class AltSvcHeaderParser : BaseHeaderParser + internal sealed class AltSvcHeaderParser : BaseHeaderParser { internal const long DefaultMaxAgeTicks = 24 * TimeSpan.TicksPerHour; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ByteArrayHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ByteArrayHeaderParser.cs index b5631b2253c8d..42c88602da00a 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ByteArrayHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ByteArrayHeaderParser.cs @@ -8,7 +8,7 @@ namespace System.Net.Http.Headers { // Don't derive from BaseHeaderParser since parsing the Base64 string is delegated to Convert.FromBase64String() // which will remove leading, trailing, and whitespace in the middle of the string. - internal class ByteArrayHeaderParser : HttpHeaderParser + internal sealed class ByteArrayHeaderParser : HttpHeaderParser { internal static readonly ByteArrayHeaderParser Parser = new ByteArrayHeaderParser(); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs index 53480344bcddc..90acab59864ed 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs @@ -5,7 +5,7 @@ namespace System.Net.Http.Headers { - internal class CacheControlHeaderParser : BaseHeaderParser + internal sealed class CacheControlHeaderParser : BaseHeaderParser { internal static readonly CacheControlHeaderParser Parser = new CacheControlHeaderParser(); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/DateHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/DateHeaderParser.cs index cfa45a84d38ad..587622d43276e 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/DateHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/DateHeaderParser.cs @@ -8,7 +8,7 @@ namespace System.Net.Http.Headers { // Don't derive from BaseHeaderParser since parsing is delegated to DateTimeOffset.TryParseExact() // which will remove leading, trailing, and whitespace in the middle of the string. - internal class DateHeaderParser : HttpHeaderParser + internal sealed class DateHeaderParser : HttpHeaderParser { internal static readonly DateHeaderParser Parser = new DateHeaderParser(); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs index 5d459603fed30..59a3e4a965c54 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs @@ -1317,7 +1317,7 @@ private bool AreEqual(object value, object? storeValue, IEqualityComparer? compa #region Private Classes - internal class HeaderStoreItemInfo + internal sealed class HeaderStoreItemInfo { internal HeaderStoreItemInfo() { } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int32NumberHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int32NumberHeaderParser.cs index 63e46f5f8055e..2b052aca7be64 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int32NumberHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int32NumberHeaderParser.cs @@ -6,7 +6,7 @@ namespace System.Net.Http.Headers { - internal class Int32NumberHeaderParser : BaseHeaderParser + internal sealed class Int32NumberHeaderParser : BaseHeaderParser { // Note that we don't need a custom comparer even though we have a value type that gets boxed (comparing two // equal boxed value types returns 'false' since the object instances used for boxing the two values are diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int64NumberHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int64NumberHeaderParser.cs index 9a1029d7b5838..12768a73d03cb 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int64NumberHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/Int64NumberHeaderParser.cs @@ -6,7 +6,7 @@ namespace System.Net.Http.Headers { - internal class Int64NumberHeaderParser : BaseHeaderParser + internal sealed class Int64NumberHeaderParser : BaseHeaderParser { // Note that we don't need a custom comparer even though we have a value type that gets boxed (comparing two // equal boxed value types returns 'false' since the object instances used for boxing the two values are diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderParser.cs index 42e4cf3f043fc..cd9884eff1678 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/MediaTypeHeaderParser.cs @@ -5,7 +5,7 @@ namespace System.Net.Http.Headers { - internal class MediaTypeHeaderParser : BaseHeaderParser + internal sealed class MediaTypeHeaderParser : BaseHeaderParser { private readonly bool _supportsMultipleValues; private readonly Func _mediaTypeCreator; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ProductInfoHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ProductInfoHeaderParser.cs index b0a17a4620c48..f224eeb10481d 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ProductInfoHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/ProductInfoHeaderParser.cs @@ -8,7 +8,7 @@ namespace System.Net.Http.Headers { // Don't derive from BaseHeaderParser since empty values are not supported. After a ' ' separator a valid value // must follow. Also leading separators are not allowed. - internal class ProductInfoHeaderParser : HttpHeaderParser + internal sealed class ProductInfoHeaderParser : HttpHeaderParser { // Unlike most other headers, User-Agent and Server use whitespace as separators private const string separator = " "; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TimeSpanHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TimeSpanHeaderParser.cs index 6aeaac12b9b0e..1d5f56c8803d5 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TimeSpanHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TimeSpanHeaderParser.cs @@ -6,7 +6,7 @@ namespace System.Net.Http.Headers { - internal class TimeSpanHeaderParser : BaseHeaderParser + internal sealed class TimeSpanHeaderParser : BaseHeaderParser { internal static readonly TimeSpanHeaderParser Parser = new TimeSpanHeaderParser(); diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TransferCodingHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TransferCodingHeaderParser.cs index 1faee74b7a899..6d87ed5096a29 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TransferCodingHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/TransferCodingHeaderParser.cs @@ -5,7 +5,7 @@ namespace System.Net.Http.Headers { - internal class TransferCodingHeaderParser : BaseHeaderParser + internal sealed class TransferCodingHeaderParser : BaseHeaderParser { private readonly Func _transferCodingCreator; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs index 37c71f52accbe..08d15634942ec 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs @@ -9,7 +9,7 @@ namespace System.Net.Http.Headers { // Don't derive from BaseHeaderParser since parsing is delegated to Uri.TryCreate() // which will remove leading and trailing whitespace. - internal class UriHeaderParser : HttpHeaderParser + internal sealed class UriHeaderParser : HttpHeaderParser { private readonly UriKind _uriKind; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.Digest.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.Digest.cs index b2d27035c5534..c9d9c7a8a02ef 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.Digest.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.Digest.cs @@ -12,7 +12,7 @@ namespace System.Net.Http { - internal partial class AuthenticationHelper + internal static partial class AuthenticationHelper { // Define digest constants private const string Qop = "qop"; @@ -240,7 +240,7 @@ private static string ComputeHash(string data, string algorithm) } } - internal class DigestResponse + internal sealed class DigestResponse { internal readonly Dictionary Parameters = new Dictionary(StringComparer.OrdinalIgnoreCase); internal const string NonceCount = "00000001"; diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs index e4218588f8073..9f254a7318a11 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs @@ -11,7 +11,7 @@ namespace System.Net.Http { - internal partial class AuthenticationHelper + internal static partial class AuthenticationHelper { private static Task InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, HttpConnectionPool pool, HttpConnection connection, CancellationToken cancellationToken) { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs index 837358cf82173..5d0fb49db747a 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs @@ -10,7 +10,7 @@ namespace System.Net.Http { - internal partial class HttpConnection + internal sealed partial class HttpConnection { private sealed class ChunkedEncodingReadStream : HttpContentReadStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingWriteStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingWriteStream.cs index e66dbf095cef9..1411e672c70f5 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingWriteStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingWriteStream.cs @@ -7,7 +7,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private sealed class ChunkedEncodingWriteStream : HttpContentWriteStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs index d061ae0969419..0fd011037b931 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ConnectionCloseReadStream.cs @@ -7,7 +7,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private sealed class ConnectionCloseReadStream : HttpContentReadStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs index 96c66654ae4ae..dd667f0706030 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthReadStream.cs @@ -8,7 +8,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private sealed class ContentLengthReadStream : HttpContentReadStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthWriteStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthWriteStream.cs index e51c5e06cbe71..7ea59751c1825 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthWriteStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ContentLengthWriteStream.cs @@ -7,7 +7,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private sealed class ContentLengthWriteStream : HttpContentWriteStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs index 9d5aa5dac2d97..256b16c8de5d8 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs @@ -17,7 +17,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : HttpConnectionBase, IDisposable + internal sealed partial class HttpConnection : HttpConnectionBase, IDisposable { /// Default size of the read buffer used for the connection. private const int InitialReadBufferSize = @@ -102,7 +102,7 @@ public HttpConnection( public void Dispose() => Dispose(disposing: true); - protected void Dispose(bool disposing) + private void Dispose(bool disposing) { // Ensure we're only disposed once. Dispose could be called concurrently, for example, // if the request and the response were running concurrently and both incurred an exception. diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentReadStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentReadStream.cs index c4e8252e6a0c2..4daad8f2b0ec7 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentReadStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentReadStream.cs @@ -7,7 +7,7 @@ namespace System.Net.Http { - internal partial class HttpConnection + internal sealed partial class HttpConnection { internal abstract class HttpContentReadStream : HttpContentStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentWriteStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentWriteStream.cs index 97aac11d4f164..5777ac8e40f74 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentWriteStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpContentWriteStream.cs @@ -8,7 +8,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private abstract class HttpContentWriteStream : HttpContentStream { diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs index 4459b2ec7fb8f..44376b01a95b2 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RawConnectionStream.cs @@ -8,7 +8,7 @@ namespace System.Net.Http { - internal partial class HttpConnection : IDisposable + internal sealed partial class HttpConnection : IDisposable { private sealed class RawConnectionStream : HttpContentStream { diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpResponseStream.Managed.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpResponseStream.Managed.cs index b084166107dfe..d804d603aa0fd 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpResponseStream.Managed.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpResponseStream.Managed.cs @@ -39,7 +39,7 @@ namespace System.Net { - internal partial class HttpResponseStream : Stream + internal sealed partial class HttpResponseStream : Stream { private HttpListenerResponse _response; private bool _ignore_errors; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpStreamAsyncResult.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpStreamAsyncResult.cs index 349fb288a2825..d0c5b1c847092 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpStreamAsyncResult.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/HttpStreamAsyncResult.cs @@ -34,7 +34,7 @@ namespace System.Net { - internal class HttpStreamAsyncResult : IAsyncResult + internal sealed class HttpStreamAsyncResult : IAsyncResult { private object _locker = new object(); private ManualResetEvent? _handle; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs index d5c2f56cd1aa0..91cdec0c0a0c4 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Managed/ListenerAsyncResult.Managed.cs @@ -36,7 +36,7 @@ namespace System.Net { - internal class ListenerAsyncResult : IAsyncResult + internal sealed class ListenerAsyncResult : IAsyncResult { private ManualResetEvent? _handle; private bool _synch; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs b/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs index 9c92cf20bb5a5..bf158e51db6da 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs @@ -9,7 +9,7 @@ namespace System.Net { - internal class ServiceNameStore + internal sealed class ServiceNameStore { private readonly List _serviceNames; private ServiceNameCollection? _serviceNameCollection; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequestContext.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequestContext.cs index d49bc4aff1a7f..e9dab38b2edf6 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequestContext.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListenerRequestContext.cs @@ -7,7 +7,7 @@ namespace System.Net { - internal class HttpListenerRequestContext : TransportContext + internal sealed class HttpListenerRequestContext : TransportContext { private readonly HttpListenerRequest _request; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBuffer.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBuffer.cs index ff12c46a88eea..838963d98d8d8 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBuffer.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBuffer.cs @@ -21,7 +21,7 @@ namespace System.Net.WebSockets // // *RBS = ReceiveBufferSize, *SBS = SendBufferSize // *PBS = PropertyBufferSize (32-bit: 16, 64 bit: 20 bytes) - internal class WebSocketBuffer : IDisposable + internal sealed class WebSocketBuffer : IDisposable { private const int NativeOverheadBufferSize = 144; private static readonly int s_PropertyBufferSize = 3 * sizeof(uint) + IntPtr.Size; diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketHttpListenerDuplexStream.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketHttpListenerDuplexStream.cs index 193b0576cb8c4..a3702c28d23aa 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketHttpListenerDuplexStream.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketHttpListenerDuplexStream.cs @@ -723,7 +723,7 @@ private static void OnReadCompleted(object? sender, HttpListenerAsyncEventArgs e } } - internal class HttpListenerAsyncEventArgs : EventArgs, IDisposable + internal sealed class HttpListenerAsyncEventArgs : EventArgs, IDisposable { private const int Free = 0; private const int InProgress = 1; @@ -874,7 +874,7 @@ public event EventHandler Completed } } - protected virtual void OnCompleted(HttpListenerAsyncEventArgs e) + private void OnCompleted(HttpListenerAsyncEventArgs e) { m_Completed?.Invoke(e._currentStream, e); } diff --git a/src/libraries/System.Net.Mail/src/System/Net/BufferedReadStream.cs b/src/libraries/System.Net.Mail/src/System/Net/BufferedReadStream.cs index 7f35b7873d50c..8c8b778f74c79 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/BufferedReadStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/BufferedReadStream.cs @@ -8,7 +8,7 @@ namespace System.Net { - internal class BufferedReadStream : DelegatedStream + internal sealed class BufferedReadStream : DelegatedStream { private byte[]? _storedBuffer; private int _storedLength; diff --git a/src/libraries/System.Net.Mail/src/System/Net/CloseableStream.cs b/src/libraries/System.Net.Mail/src/System/Net/CloseableStream.cs index b4f3cdac9c1a0..adf9f88c0c10d 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/CloseableStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/CloseableStream.cs @@ -7,7 +7,7 @@ namespace System.Net { /// Provides a stream that notifies an event when the Close method is called. - internal class ClosableStream : DelegatedStream + internal sealed class ClosableStream : DelegatedStream { private readonly EventHandler? _onClose; private int _closed; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailPriority.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailPriority.cs index 4b4fabb800fca..aed784ce95b50 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailPriority.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailPriority.cs @@ -15,7 +15,7 @@ public enum MailPriority High = 2 } - internal class Message + internal sealed class Message { #region Fields @@ -235,7 +235,7 @@ internal HeaderCollection EnvelopeHeaders } [DisallowNull] - internal virtual MimeBasePart? Content + internal MimeBasePart? Content { get { @@ -277,7 +277,7 @@ internal void EmptySendCallback(IAsyncResult result) context._result.InvokeCallback(e); } - internal class EmptySendContext + internal sealed class EmptySendContext { internal EmptySendContext(BaseWriter writer, LazyAsyncResult result) { @@ -289,7 +289,7 @@ internal EmptySendContext(BaseWriter writer, LazyAsyncResult result) internal BaseWriter _writer; } - internal virtual IAsyncResult BeginSend(BaseWriter writer, bool sendEnvelope, bool allowUnicode, + internal IAsyncResult BeginSend(BaseWriter writer, bool sendEnvelope, bool allowUnicode, AsyncCallback? callback, object? state) { PrepareHeaders(sendEnvelope, allowUnicode); @@ -312,7 +312,7 @@ internal virtual IAsyncResult BeginSend(BaseWriter writer, bool sendEnvelope, bo } } - internal virtual void EndSend(IAsyncResult asyncResult) + internal void EndSend(IAsyncResult asyncResult) { if (asyncResult == null) { @@ -346,7 +346,7 @@ internal virtual void EndSend(IAsyncResult asyncResult) } } - internal virtual void Send(BaseWriter writer, bool sendEnvelope, bool allowUnicode) + internal void Send(BaseWriter writer, bool sendEnvelope, bool allowUnicode) { if (sendEnvelope) { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailWriter.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailWriter.cs index 6761539a2d411..f41b6992e6563 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/MailWriter.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/MailWriter.cs @@ -8,7 +8,7 @@ namespace System.Net.Mail { - internal class MailWriter : BaseWriter + internal sealed class MailWriter : BaseWriter { /// /// ctor. diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.Auth.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.Auth.cs index 362abc10db353..0fa1b892fd9a5 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.Auth.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.Auth.cs @@ -11,7 +11,7 @@ internal enum SupportedAuth GSSAPI = 4 }; - internal partial class SmtpConnection + internal sealed partial class SmtpConnection { private bool _serverSupportsEai; private bool _dsnEnabled; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs index 0bebb524a9f67..e883bfe897701 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs @@ -17,7 +17,7 @@ namespace System.Net.Mail { - internal partial class SmtpConnection + internal sealed partial class SmtpConnection { private static readonly ContextCallback s_AuthenticateCallback = new ContextCallback(AuthenticateCallback); diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReader.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReader.cs index ddc227fe28e9c..e82db3d7e9ebc 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReader.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReader.cs @@ -7,7 +7,7 @@ namespace System.Net.Mail { //streams are read only; return of 0 means end of server's reply - internal class SmtpReplyReader + internal sealed class SmtpReplyReader { private readonly SmtpReplyReaderFactory _reader; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReaderFactory.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReaderFactory.cs index 76754d53b5a91..099a10ecab784 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReaderFactory.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpReplyReaderFactory.cs @@ -10,7 +10,7 @@ namespace System.Net.Mail { //Streams created are read only and return 0 once a full server reply has been read //To get the next server reply, call GetNextReplyReader - internal class SmtpReplyReaderFactory + internal sealed class SmtpReplyReaderFactory { private enum ReadState { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpTransport.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpTransport.cs index 2e427ec372ebd..623bff7d5755d 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpTransport.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpTransport.cs @@ -10,7 +10,7 @@ namespace System.Net.Mail { - internal class SmtpTransport + internal sealed class SmtpTransport { internal const int DefaultPort = 25; @@ -253,7 +253,7 @@ internal MailWriter SendMail(MailAddress sender, MailAddressCollection recipient } } - internal class SendMailAsyncResult : LazyAsyncResult + internal sealed class SendMailAsyncResult : LazyAsyncResult { private readonly SmtpConnection _connection; private readonly MailAddress _from; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs index 3ddd40bf6384e..1c08b36f0536a 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64Encoder.cs @@ -5,7 +5,7 @@ namespace System.Net.Mime { - internal class Base64Encoder : ByteEncoder + internal sealed class Base64Encoder : ByteEncoder { private static ReadOnlySpan Base64EncodeMap => new byte[] { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64WriteStateInfo.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64WriteStateInfo.cs index ba534e09994d9..726a0b988bb03 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64WriteStateInfo.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/Base64WriteStateInfo.cs @@ -3,7 +3,7 @@ namespace System.Net.Mime { - internal class Base64WriteStateInfo : WriteStateInfoBase + internal sealed class Base64WriteStateInfo : WriteStateInfoBase { internal Base64WriteStateInfo() { } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs index 16fa22cd74302..55b71f81a09f4 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs @@ -21,7 +21,7 @@ namespace System.Net.Mime /// For legacy (app-compat) reasons we have chosen to remove the enforcement /// and rename the class from SevenBitStream to EightBitStream. /// - internal class EightBitStream : DelegatedStream, IEncodableStream + internal sealed class EightBitStream : DelegatedStream, IEncodableStream { private WriteStateInfoBase? _writeState; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/EncodedStreamFactory.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/EncodedStreamFactory.cs index 270cb00956655..a82d3676f5ddf 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/EncodedStreamFactory.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/EncodedStreamFactory.cs @@ -5,7 +5,7 @@ namespace System.Net.Mime { - internal class EncodedStreamFactory + internal sealed class EncodedStreamFactory { //RFC 2822: no encoded-word line should be longer than 76 characters not including the soft CRLF //since the header length is unknown (if there even is one) we're going to be slightly more conservative @@ -20,7 +20,7 @@ internal class EncodedStreamFactory internal IEncodableStream GetEncoderForHeader(Encoding encoding, bool useBase64Encoding, int headerTextLength) { byte[] header = CreateHeader(encoding, useBase64Encoding); - byte[] footer = CreateFooter(); + byte[] footer = s_footer; WriteStateInfoBase writeState; if (useBase64Encoding) @@ -36,10 +36,10 @@ internal IEncodableStream GetEncoderForHeader(Encoding encoding, bool useBase64E //Create the header for what type of byte encoding is going to be used //based on the encoding type and if base64 encoding should be forced //sample header: =?utf-8?B? - protected byte[] CreateHeader(Encoding encoding, bool useBase64Encoding) => + private byte[] CreateHeader(Encoding encoding, bool useBase64Encoding) => Encoding.ASCII.GetBytes("=?" + encoding.HeaderName + "?" + (useBase64Encoding ? "B?" : "Q?")); - //creates the footer that marks the end of a quoted string of some sort - protected byte[] CreateFooter() => new byte[] { (byte)'?', (byte)'=' }; + //The footer that marks the end of a quoted string of some sort + private static readonly byte[] s_footer = new byte[] { (byte)'?', (byte)'=' }; } } diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/HeaderCollection.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/HeaderCollection.cs index 239b3ba59d88f..89f988930f6ef 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/HeaderCollection.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/HeaderCollection.cs @@ -10,7 +10,7 @@ namespace System.Net.Mime /// /// Summary description for HeaderCollection. /// - internal class HeaderCollection : NameValueCollection + internal sealed class HeaderCollection : NameValueCollection { // default constructor // intentionally override the default comparer in the derived base class diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs index b5e0abab07948..be3092fa30629 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeBasePart.cs @@ -252,7 +252,7 @@ internal void EndSend(IAsyncResult asyncResult) } } - internal class MimePartAsyncResult : LazyAsyncResult + internal sealed class MimePartAsyncResult : LazyAsyncResult { internal MimePartAsyncResult(MimeBasePart part, object? state, AsyncCallback? callback) : base(part, state, callback) { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeMultiPart.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeMultiPart.cs index 95c5362d6fac3..bb300289dfa8c 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeMultiPart.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeMultiPart.cs @@ -10,7 +10,7 @@ namespace System.Net.Mime { - internal class MimeMultiPart : MimeBasePart + internal sealed class MimeMultiPart : MimeBasePart { private Collection? _parts; private static int s_boundary; @@ -213,7 +213,7 @@ internal override IAsyncResult BeginSend(BaseWriter writer, AsyncCallback? callb return result; } - internal class MimePartContext + internal sealed class MimePartContext { internal MimePartContext(BaseWriter writer, LazyAsyncResult result, IEnumerator partsEnumerator) { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs index 886e00192e2fc..218df997c6e22 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimePart.cs @@ -14,7 +14,7 @@ namespace System.Net.Mime /// /// Summary description for MimePart. /// - internal class MimePart : MimeBasePart, IDisposable + internal sealed class MimePart : MimeBasePart, IDisposable { private Stream? _stream; private bool _streamSet; @@ -301,7 +301,7 @@ internal void ContentStreamCallback(IAsyncResult result) } } - internal class MimePartContext + internal sealed class MimePartContext { internal MimePartContext(BaseWriter writer, LazyAsyncResult result) { diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeWriter.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeWriter.cs index 3974d68407976..8439cfa8f48f4 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeWriter.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/MimeWriter.cs @@ -12,7 +12,7 @@ namespace System.Net.Mime /// Provides an abstraction for writing a MIME multi-part /// message. /// - internal class MimeWriter : BaseWriter + internal sealed class MimeWriter : BaseWriter { private static readonly byte[] s_DASHDASH = new byte[] { (byte)'-', (byte)'-' }; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs index 72097775c05cf..5aa6273c42c62 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs @@ -13,7 +13,7 @@ namespace System.Net.Mime /// buffer as the data being encoded will most likely grow. /// Encoding and decoding is done transparently to the caller. /// - internal class QEncodedStream : DelegatedStream, IEncodableStream + internal sealed class QEncodedStream : DelegatedStream, IEncodableStream { private static ReadOnlySpan HexDecodeMap => new byte[] // rely on C# compiler optimization to eliminate allocation diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs index 76809cbd33def..ce4a0f57227fe 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncoder.cs @@ -3,7 +3,7 @@ namespace System.Net.Mime { - internal class QEncoder : ByteEncoder + internal sealed class QEncoder : ByteEncoder { private const int SizeOfQEncodedChar = 3; // e.g. "=3A" diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs index eadab7b9f6d0f..0fa988eca3a28 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs @@ -16,7 +16,7 @@ namespace System.Net.Mime /// This stream should only be used for the e-mail content. /// Use QEncodedStream for encoding headers. /// - internal class QuotedPrintableStream : DelegatedStream, IEncodableStream + internal sealed class QuotedPrintableStream : DelegatedStream, IEncodableStream { //should we encode CRLF or not? private readonly bool _encodeCRLF; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/SmtpDateTime.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/SmtpDateTime.cs index 4371d99ec3ad2..106fc5540a63c 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/SmtpDateTime.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/SmtpDateTime.cs @@ -31,7 +31,7 @@ namespace System.Net.Mime // stores a Date and a Time Zone. These are parsed and formatted according to the // rules in RFC 2822 section 3.3. // This class is immutable - internal class SmtpDateTime + internal sealed class SmtpDateTime { #region constants diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPGlobalProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPGlobalProperties.cs index c4b5d6c38bbec..9ed00ca897125 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPGlobalProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPGlobalProperties.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIPGlobalProperties : UnixIPGlobalProperties + internal sealed class BsdIPGlobalProperties : UnixIPGlobalProperties { private unsafe TcpConnectionInformation[] GetTcpConnections(bool listeners) { diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4GlobalStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4GlobalStatistics.cs index 83229a5cebbb1..3d4ffd351568a 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4GlobalStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4GlobalStatistics.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIPv4GlobalStatistics : IPGlobalStatistics + internal sealed class BsdIPv4GlobalStatistics : IPGlobalStatistics { private readonly long _outboundPackets; private readonly long _outputPacketsNoRoute; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceProperties.cs index aebe697c06c63..f847538cd353e 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceProperties.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIPv4InterfaceProperties : UnixIPv4InterfaceProperties + internal sealed class BsdIPv4InterfaceProperties : UnixIPv4InterfaceProperties { private readonly int _mtu; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceStatistics.cs index 6286570a3352d..4a9545432824b 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv4InterfaceStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIPv4InterfaceStatistics : IPv4InterfaceStatistics + internal sealed class BsdIPv4InterfaceStatistics : IPv4InterfaceStatistics { private readonly BsdIpInterfaceStatistics _statistics; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv6InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv6InterfaceProperties.cs index 6c54c0463cab1..8ef7674e78a88 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv6InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIPv6InterfaceProperties.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIPv6InterfaceProperties : UnixIPv6InterfaceProperties + internal sealed class BsdIPv6InterfaceProperties : UnixIPv6InterfaceProperties { private readonly int _mtu; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV4Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV4Statistics.cs index 2e2266d2c969b..d8322222a851f 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV4Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV4Statistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIcmpV4Statistics : IcmpV4Statistics + internal sealed class BsdIcmpV4Statistics : IcmpV4Statistics { private readonly long _addressMaskRepliesReceived; private readonly long _addressMaskRepliesSent; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV6Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV6Statistics.cs index 34596a51d3b6b..fe23a313fede2 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV6Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIcmpV6Statistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIcmpV6Statistics : IcmpV6Statistics + internal sealed class BsdIcmpV6Statistics : IcmpV6Statistics { private readonly long _destinationUnreachableMessagesReceived; private readonly long _destinationUnreachableMessagesSent; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceProperties.cs index 9a1c548bc402a..93b92532b42c3 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceProperties.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIpInterfaceProperties : UnixIPInterfaceProperties + internal sealed class BsdIpInterfaceProperties : UnixIPInterfaceProperties { private readonly BsdIPv4InterfaceProperties _ipv4Properties; private readonly BsdIPv6InterfaceProperties _ipv6Properties; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceStatistics.cs index b74fa0e5dc806..94bd148613a69 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdIpInterfaceStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdIpInterfaceStatistics : IPInterfaceStatistics + internal sealed class BsdIpInterfaceStatistics : IPInterfaceStatistics { private readonly long _outputQueueLength; private readonly long _inPackets; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdNetworkInterface.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdNetworkInterface.cs index b5ebbd5c1b05d..16aa0ed05ef47 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdNetworkInterface.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdNetworkInterface.cs @@ -5,14 +5,14 @@ namespace System.Net.NetworkInformation { - internal class BsdNetworkInterface : UnixNetworkInterface + internal sealed class BsdNetworkInterface : UnixNetworkInterface { private readonly BsdIpInterfaceProperties _ipProperties; private readonly OperationalStatus _operationalStatus; private readonly bool _supportsMulticast; private readonly long _speed; - protected unsafe BsdNetworkInterface(string name, int index) : base(name) + private unsafe BsdNetworkInterface(string name, int index) : base(name) { _index = index; Interop.Sys.NativeIPInterfaceStatistics nativeStats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdTcpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdTcpStatistics.cs index adaa3d9b54600..ba8b649320539 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdTcpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdTcpStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class BsdTcpStatistics : TcpStatistics + internal sealed class BsdTcpStatistics : TcpStatistics { private readonly long _connectionsAccepted; private readonly long _connectionsInitiated; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdUdpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdUdpStatistics.cs index 8b7df8ac4fb89..c60a62173e6da 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdUdpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/BsdUdpStatistics.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class BsdUdpStatistics : UdpStatistics + internal sealed class BsdUdpStatistics : UdpStatistics { private readonly long _datagramsReceived; private readonly long _datagramsSent; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/InternalIPAddressCollection.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/InternalIPAddressCollection.cs index 03e7236943a78..0020c73b1c14f 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/InternalIPAddressCollection.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/InternalIPAddressCollection.cs @@ -5,11 +5,11 @@ namespace System.Net.NetworkInformation { - internal class InternalIPAddressCollection : IPAddressCollection + internal sealed class InternalIPAddressCollection : IPAddressCollection { private readonly List _addresses; - protected internal InternalIPAddressCollection() + internal InternalIPAddressCollection() { _addresses = new List(); } diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPAddressInformation.cs index b053e499c498f..e2bc3f91a70a2 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPAddressInformation.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPAddressInformation : IPAddressInformation + internal sealed class LinuxIPAddressInformation : IPAddressInformation { private readonly IPAddress _address; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalProperties.cs index 792cea3877961..52f09dbed8319 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalProperties.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPGlobalProperties : UnixIPGlobalProperties + internal sealed class LinuxIPGlobalProperties : UnixIPGlobalProperties { public override TcpConnectionInformation[] GetActiveTcpConnections() { diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalStatistics.cs index 99c5faa298ee4..6254c1d44531c 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPGlobalStatistics.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPGlobalStatistics : IPGlobalStatistics + internal sealed class LinuxIPGlobalStatistics : IPGlobalStatistics { // MIB-II statistics data. private readonly IPGlobalStatisticsTable _table; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceProperties.cs index aae4821a4490b..99295ca32ca39 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceProperties.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPInterfaceProperties : UnixIPInterfaceProperties + internal sealed class LinuxIPInterfaceProperties : UnixIPInterfaceProperties { private readonly LinuxNetworkInterface _linuxNetworkInterface; private readonly GatewayIPAddressInformationCollection _gatewayAddresses; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceStatistics.cs index 12c6b640527b1..5f7d62841fab4 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPInterfaceStatistics.cs @@ -9,7 +9,7 @@ namespace System.Net.NetworkInformation /// IPInterfaceStatistics provider for Linux. /// Reads information out of /proc/net/dev and other locations. /// - internal class LinuxIPInterfaceStatistics : IPInterfaceStatistics + internal sealed class LinuxIPInterfaceStatistics : IPInterfaceStatistics { // /proc/net/dev statistics table for network interface private readonly IPInterfaceStatisticsTable _table; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceProperties.cs index b4af668bd4395..0f0557b7af96e 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceProperties.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPv4InterfaceProperties : UnixIPv4InterfaceProperties + internal sealed class LinuxIPv4InterfaceProperties : UnixIPv4InterfaceProperties { private readonly LinuxNetworkInterface _linuxNetworkInterface; private readonly bool _isForwardingEnabled; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceStatistics.cs index 708dee0213092..ec0b7a2642cc1 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv4InterfaceStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPv4InterfaceStatistics : IPv4InterfaceStatistics + internal sealed class LinuxIPv4InterfaceStatistics : IPv4InterfaceStatistics { private readonly LinuxIPInterfaceStatistics _statistics; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv6InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv6InterfaceProperties.cs index 90d4d14797bbe..400a92d0c4909 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv6InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIPv6InterfaceProperties.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIPv6InterfaceProperties : UnixIPv6InterfaceProperties + internal sealed class LinuxIPv6InterfaceProperties : UnixIPv6InterfaceProperties { private readonly LinuxNetworkInterface _linuxNetworkInterface; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV4Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV4Statistics.cs index d5d3fc700b822..85e073b977afb 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV4Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV4Statistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIcmpV4Statistics : IcmpV4Statistics + internal sealed class LinuxIcmpV4Statistics : IcmpV4Statistics { private readonly Icmpv4StatisticsTable _table; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV6Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV6Statistics.cs index 44121ae4001a7..50ba8bd305e6c 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV6Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxIcmpV6Statistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxIcmpV6Statistics : IcmpV6Statistics + internal sealed class LinuxIcmpV6Statistics : IcmpV6Statistics { private readonly Icmpv6StatisticsTable _table; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs index d881a924bc367..c835deebd2396 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxNetworkInterface.cs @@ -11,7 +11,7 @@ namespace System.Net.NetworkInformation /// /// Implements a NetworkInterface on Linux. /// - internal class LinuxNetworkInterface : UnixNetworkInterface + internal sealed class LinuxNetworkInterface : UnixNetworkInterface { private OperationalStatus _operationalStatus; private bool _supportsMulticast; @@ -20,7 +20,7 @@ internal class LinuxNetworkInterface : UnixNetworkInterface private NetworkInterfaceType _interfaceType = NetworkInterfaceType.Unknown; private readonly LinuxIPInterfaceProperties _ipProperties; - internal class LinuxNetworkInterfaceSystemProperties + internal sealed class LinuxNetworkInterfaceSystemProperties { internal string[]? IPv4Routes; internal string[]? IPv6Routes; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxTcpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxTcpStatistics.cs index 2d8d1d167a65a..91e61ee6e0ab3 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxTcpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxTcpStatistics.cs @@ -4,7 +4,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxTcpStatistics : TcpStatistics + internal sealed class LinuxTcpStatistics : TcpStatistics { private readonly TcpGlobalStatisticsTable _table; private readonly int _currentConnections; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxUdpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxUdpStatistics.cs index 2f0fbef2a01e4..648e383005848 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxUdpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/LinuxUdpStatistics.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { - internal class LinuxUdpStatistics : UdpStatistics + internal sealed class LinuxUdpStatistics : UdpStatistics { private readonly UdpGlobalStatisticsTable _table; private readonly int _udpListeners; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleGatewayIPAddressInformation.Unix.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleGatewayIPAddressInformation.Unix.cs index ae304a348120a..71bdb60b72336 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleGatewayIPAddressInformation.Unix.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleGatewayIPAddressInformation.Unix.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class SimpleGatewayIPAddressInformation : GatewayIPAddressInformation + internal sealed class SimpleGatewayIPAddressInformation : GatewayIPAddressInformation { private readonly IPAddress _address; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleTcpConnectionInformation.Unix.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleTcpConnectionInformation.Unix.cs index 90910da01882c..5ed3fe7837e7c 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleTcpConnectionInformation.Unix.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SimpleTcpConnectionInformation.Unix.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class SimpleTcpConnectionInformation : TcpConnectionInformation + internal sealed class SimpleTcpConnectionInformation : TcpConnectionInformation { private IPEndPoint _localEndPoint; private IPEndPoint _remoteEndPoint; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs index 3bcde94263309..721ff1856f0b5 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemGatewayIPAddressInformation.cs @@ -4,7 +4,7 @@ namespace System.Net.NetworkInformation { /// Provides information about a network interface address. - internal class SystemGatewayIPAddressInformation : GatewayIPAddressInformation + internal sealed class SystemGatewayIPAddressInformation : GatewayIPAddressInformation { private readonly IPAddress _address; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPAddressInformation.cs index 603e081e5bfb5..3fe65234d529e 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPAddressInformation.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { // This is the main addressinformation class that contains the ipaddress // and other properties. - internal class SystemIPAddressInformation : IPAddressInformation + internal sealed class SystemIPAddressInformation : IPAddressInformation { private readonly IPAddress _address; internal readonly bool Transient; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPGlobalStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPGlobalStatistics.cs index 329d577503870..e8838b31d0c24 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPGlobalStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPGlobalStatistics.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { /// IP statistics. - internal class SystemIPGlobalStatistics : IPGlobalStatistics + internal sealed class SystemIPGlobalStatistics : IPGlobalStatistics { private readonly Interop.IpHlpApi.MibIpStats _stats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceProperties.cs index f3846aafc5e74..6d261115b1eec 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceProperties.cs @@ -9,7 +9,7 @@ namespace System.Net.NetworkInformation // Note: Provides information specific to a network interface. A network interface can have more // than one IPAddress associated with it. We call the native GetAdaptersAddresses API to // pre-populate all of the interface instances and most of their associated information. - internal class SystemIPInterfaceProperties : IPInterfaceProperties + internal sealed class SystemIPInterfaceProperties : IPInterfaceProperties { // These are valid for all interfaces. private readonly bool _dnsEnabled; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceStatistics.cs index 2b20bf7a945ae..a572c04c758e9 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPInterfaceStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class SystemIPInterfaceStatistics : IPInterfaceStatistics + internal sealed class SystemIPInterfaceStatistics : IPInterfaceStatistics { private readonly Interop.IpHlpApi.MibIfRow2 _ifRow; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceProperties.cs index 09386c2b1b58a..72accfe9f4514 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceProperties.cs @@ -7,7 +7,7 @@ namespace System.Net.NetworkInformation { - internal class SystemIPv4InterfaceProperties : IPv4InterfaceProperties + internal sealed class SystemIPv4InterfaceProperties : IPv4InterfaceProperties { // These are only valid for ipv4 interfaces. private readonly bool _haveWins; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceStatistics.cs index eddc2aeb34991..82466c914940f 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv4InterfaceStatistics.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class SystemIPv4InterfaceStatistics : IPv4InterfaceStatistics + internal sealed class SystemIPv4InterfaceStatistics : IPv4InterfaceStatistics { private readonly Interop.IpHlpApi.MibIfRow2 _ifRow; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv6InterfaceProperties.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv6InterfaceProperties.cs index 65e8569fd8fc9..eedf426fd1f4b 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv6InterfaceProperties.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIPv6InterfaceProperties.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class SystemIPv6InterfaceProperties : IPv6InterfaceProperties + internal sealed class SystemIPv6InterfaceProperties : IPv6InterfaceProperties { private readonly uint _index; private readonly uint _mtu; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV4Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV4Statistics.cs index 1ac442f1e777c..a2294d8ad5ef6 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV4Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV4Statistics.cs @@ -4,7 +4,7 @@ namespace System.Net.NetworkInformation { // ICMP statistics for IPv4. - internal class SystemIcmpV4Statistics : IcmpV4Statistics + internal sealed class SystemIcmpV4Statistics : IcmpV4Statistics { private readonly Interop.IpHlpApi.MibIcmpInfo _stats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV6Statistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV6Statistics.cs index 4fc0a2f2e520c..778a925afc5a5 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV6Statistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemIcmpV6Statistics.cs @@ -24,7 +24,7 @@ internal enum IcmpV6StatType } // ICMP statistics for Ipv6. - internal class SystemIcmpV6Statistics : IcmpV6Statistics + internal sealed class SystemIcmpV6Statistics : IcmpV6Statistics { private readonly Interop.IpHlpApi.MibIcmpInfoEx _stats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs index 034720807ee04..71ed8e9b66e9e 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemMulticastIPAddressInformation.cs @@ -4,7 +4,7 @@ namespace System.Net.NetworkInformation { // Specifies the Multicast addresses for an interface. - internal class SystemMulticastIPAddressInformation : MulticastIPAddressInformation + internal sealed class SystemMulticastIPAddressInformation : MulticastIPAddressInformation { private readonly SystemIPAddressInformation _innerInfo; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemNetworkInterface.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemNetworkInterface.cs index 5941219ea6faa..f2196e3b79a4d 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemNetworkInterface.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemNetworkInterface.cs @@ -9,7 +9,7 @@ namespace System.Net.NetworkInformation { - internal class SystemNetworkInterface : NetworkInterface + internal sealed class SystemNetworkInterface : NetworkInterface { private readonly string _name; private readonly string _id; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpConnection.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpConnection.cs index 069e61f4fe83d..0237fcb3cb1c7 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpConnection.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpConnection.cs @@ -4,7 +4,7 @@ namespace System.Net.NetworkInformation { // Represents an active TCP connection. - internal class SystemTcpConnectionInformation : TcpConnectionInformation + internal sealed class SystemTcpConnectionInformation : TcpConnectionInformation { private readonly IPEndPoint _localEndPoint; private readonly IPEndPoint _remoteEndPoint; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpStatistics.cs index 617e58f8b5b58..32453ce74c6a3 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemTcpStatistics.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { // TCP specific statistics. - internal class SystemTcpStatistics : TcpStatistics + internal sealed class SystemTcpStatistics : TcpStatistics { private readonly Interop.IpHlpApi.MibTcpStats _stats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUdpStatistics.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUdpStatistics.cs index 7d3978f66473a..20869e1f8c684 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUdpStatistics.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUdpStatistics.cs @@ -6,7 +6,7 @@ namespace System.Net.NetworkInformation { // UDP statistics. - internal class SystemUdpStatistics : UdpStatistics + internal sealed class SystemUdpStatistics : UdpStatistics { private readonly Interop.IpHlpApi.MibUdpStats _stats; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs index f1274549c2d7e..e9ed56ff453fe 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/SystemUnicastIPAddressInformation.cs @@ -8,7 +8,7 @@ namespace System.Net.NetworkInformation { // Specifies the unicast addresses for an interface. - internal class SystemUnicastIPAddressInformation : UnicastIPAddressInformation + internal sealed class SystemUnicastIPAddressInformation : UnicastIPAddressInformation { private readonly long _dhcpLeaseLifetime; private readonly SystemIPAddressInformation _innerInfo; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/TeredoHelper.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/TeredoHelper.cs index 349c5e80e900d..d75c0a3a5b4a2 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/TeredoHelper.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/TeredoHelper.cs @@ -24,7 +24,7 @@ namespace System.Net.NetworkInformation // and that no new calls to the callback will be issued. // - internal class TeredoHelper + internal sealed class TeredoHelper { private readonly Action _callback; private readonly object _state; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixMulticastIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixMulticastIPAddressInformation.cs index 9caea94a81643..1a21e4e1efdac 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixMulticastIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixMulticastIPAddressInformation.cs @@ -3,7 +3,7 @@ namespace System.Net.NetworkInformation { - internal class UnixMulticastIPAddressInformation : MulticastIPAddressInformation + internal sealed class UnixMulticastIPAddressInformation : MulticastIPAddressInformation { private readonly IPAddress _address; diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixUnicastIPAddressInformation.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixUnicastIPAddressInformation.cs index e45ce2cf771dc..36034cac75eba 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixUnicastIPAddressInformation.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/UnixUnicastIPAddressInformation.cs @@ -5,7 +5,7 @@ namespace System.Net.NetworkInformation { /// Provides information about a network interface's unicast address - internal class UnixUnicastIPAddressInformation : UnicastIPAddressInformation + internal sealed class UnixUnicastIPAddressInformation : UnicastIPAddressInformation { private readonly IPAddress _address; private readonly int _prefixLength; diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs index b52b48282e218..b4dbc40bfa460 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicApi.cs @@ -12,7 +12,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal { - internal class MsQuicApi : IDisposable + internal sealed class MsQuicApi : IDisposable { private bool _disposed; diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs index 68b1432028b66..4c941c0dc1e71 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/MsQuicSecurityConfig.cs @@ -5,7 +5,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal { // TODO this will eventually be abstracted to support both Client and Server // certificates - internal class MsQuicSecurityConfig : IDisposable + internal sealed class MsQuicSecurityConfig : IDisposable { private bool _disposed; private MsQuicApi _registration; diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs index b1ac4c17552bd..fb94687962ee1 100644 --- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs +++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Internal/ResettableCompletionSource.cs @@ -10,9 +10,9 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal /// A resettable completion source which can be completed multiple times. /// Used to make methods async between completed events and their associated async method. /// - internal class ResettableCompletionSource : IValueTaskSource, IValueTaskSource + internal sealed class ResettableCompletionSource : IValueTaskSource, IValueTaskSource { - protected ManualResetValueTaskSourceCore _valueTaskSource; + private ManualResetValueTaskSourceCore _valueTaskSource; public ResettableCompletionSource() { diff --git a/src/libraries/System.Net.Requests/src/System/Net/CommandStream.cs b/src/libraries/System.Net.Requests/src/System/Net/CommandStream.cs index 0031514161017..41f22087d5a8a 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/CommandStream.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/CommandStream.cs @@ -373,7 +373,7 @@ internal enum PipelineEntryFlags DontLogParameter = 0x8 } - internal class PipelineEntry + internal sealed class PipelineEntry { internal PipelineEntry(string command) { @@ -678,7 +678,7 @@ private void ReceiveCommandResponseCallback(ReceiveState state, int bytesRead) /// /// Contains the parsed status line from the server /// - internal class ResponseDescription + internal sealed class ResponseDescription { internal const int NoStatus = -1; internal bool Multiline; @@ -699,7 +699,7 @@ internal class ResponseDescription /// /// State information that is used during ReceiveCommandResponse()'s async operations /// - internal class ReceiveState + internal sealed class ReceiveState { private const int bufferSize = 1024; diff --git a/src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs b/src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs index a2dc4cf852828..c7f61c649c62b 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/FtpControlStream.cs @@ -24,7 +24,7 @@ internal enum FtpLoginState : byte /// This means basic command sending and parsing. /// /// - internal class FtpControlStream : CommandStream + internal sealed class FtpControlStream : CommandStream { private Socket? _dataSocket; private IPEndPoint? _passiveEndPoint; @@ -1129,7 +1129,7 @@ private string FormatFtpCommand(string command, string? parameter) /// This will handle either connecting to a port or listening for one /// /// - protected Socket CreateFtpDataSocket(FtpWebRequest request, Socket templateSocket) + private Socket CreateFtpDataSocket(FtpWebRequest request, Socket templateSocket) { // Safe to be called under an Assert. Socket socket = new Socket(templateSocket.AddressFamily, templateSocket.SocketType, templateSocket.ProtocolType); diff --git a/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs b/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs index 10fafe3c0b5b1..fb86000f41774 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/FtpDataStream.cs @@ -12,7 +12,7 @@ namespace System.Net /// The FtpDataStream class implements the FTP data connection. /// /// - internal class FtpDataStream : Stream, ICloseEx + internal sealed class FtpDataStream : Stream, ICloseEx { private readonly FtpWebRequest _request; private readonly NetworkStream _networkStream; diff --git a/src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs b/src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs index b1f9f4a7c1c29..1e434b400e983 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/FtpWebRequest.cs @@ -47,7 +47,7 @@ internal enum FtpMethodFlags MustChangeWorkingDirectoryToPath = 0x100 } - internal class FtpMethodInfo + internal sealed class FtpMethodInfo { internal string Method; internal FtpOperation Operation; @@ -1754,7 +1754,7 @@ internal void DataStreamClosed(CloseExState closeState) // // Class used by the WebRequest.Create factory to create FTP requests // - internal class FtpWebRequestCreator : IWebRequestCreate + internal sealed class FtpWebRequestCreator : IWebRequestCreate { internal FtpWebRequestCreator() { diff --git a/src/libraries/System.Net.Requests/src/System/Net/WebRequest.cs b/src/libraries/System.Net.Requests/src/System/Net/WebRequest.cs index bcdce17c44bf8..0614718c2b95c 100644 --- a/src/libraries/System.Net.Requests/src/System/Net/WebRequest.cs +++ b/src/libraries/System.Net.Requests/src/System/Net/WebRequest.cs @@ -16,7 +16,7 @@ namespace System.Net { public abstract class WebRequest : MarshalByRefObject, ISerializable { - internal class WebRequestPrefixElement + internal sealed class WebRequestPrefixElement { public readonly string Prefix; public readonly IWebRequestCreate Creator; @@ -324,7 +324,7 @@ public static bool RegisterPrefix(string prefix, IWebRequestCreate creator) return !Error; } - internal class HttpRequestCreator : IWebRequestCreate + internal sealed class HttpRequestCreator : IWebRequestCreate { // Create - Create an HttpWebRequest. // diff --git a/src/libraries/System.Net.Security/src/System/Net/NTAuthentication.cs b/src/libraries/System.Net.Security/src/System/Net/NTAuthentication.cs index daadb4866ac4a..93b77ffbba0d3 100644 --- a/src/libraries/System.Net.Security/src/System/Net/NTAuthentication.cs +++ b/src/libraries/System.Net.Security/src/System/Net/NTAuthentication.cs @@ -8,7 +8,7 @@ namespace System.Net { - internal partial class NTAuthentication + internal sealed partial class NTAuthentication { internal string? AssociatedName { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Android.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Android.cs index 1dfc4818d5888..b96c301c7d512 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Android.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Android.cs @@ -6,7 +6,7 @@ namespace System.Net.Security { - internal class CipherSuitesPolicyPal + internal sealed class CipherSuitesPolicyPal { internal TlsCipherSuite[] TlsCipherSuites { get; private set; } diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs index b01cfe6f1edbe..0ddef7980c836 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Linux.cs @@ -12,7 +12,7 @@ namespace System.Net.Security { - internal class CipherSuitesPolicyPal + internal sealed class CipherSuitesPolicyPal { private static readonly byte[] AllowNoEncryptionDefault = Encoding.ASCII.GetBytes("ALL:eNULL\0"); diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.OSX.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.OSX.cs index a5fa2ba4072fe..4838e4738a399 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.OSX.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.OSX.cs @@ -6,7 +6,7 @@ namespace System.Net.Security { - internal class CipherSuitesPolicyPal + internal sealed class CipherSuitesPolicyPal { internal uint[] TlsCipherSuites { get; private set; } diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Windows.cs b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Windows.cs index adecd6fa44253..899637c97c2fb 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Windows.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/CipherSuitesPolicyPal.Windows.cs @@ -5,7 +5,7 @@ namespace System.Net.Security { - internal class CipherSuitesPolicyPal + internal sealed class CipherSuitesPolicyPal { internal CipherSuitesPolicyPal(IEnumerable allowedCipherSuites) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs index 8c54dbbd71921..0e287e097c60d 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs @@ -15,7 +15,7 @@ namespace System.Net.Security { // SecureChannel - a wrapper on SSPI based functionality. // Provides an additional abstraction layer over SSPI for SslStream. - internal class SecureChannel + internal sealed class SecureChannel { // When reading a frame from the wire first read this many bytes for the header. internal const int ReadHeaderSize = 5; @@ -1215,7 +1215,7 @@ private void LogCertificateValidation(RemoteCertificateValidationCallback? remot } // ProtocolToken - used to process and handle the return codes from the SSPI wrapper - internal class ProtocolToken + internal sealed class ProtocolToken { internal SecurityStatusPal Status; internal byte[]? Payload; diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs index d3f99e6e9b415..b538821ada0b8 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslAuthenticationOptions.cs @@ -8,7 +8,7 @@ namespace System.Net.Security { - internal class SslAuthenticationOptions + internal sealed class SslAuthenticationOptions { internal SslAuthenticationOptions(SslClientAuthenticationOptions sslClientAuthenticationOptions, RemoteCertificateValidationCallback? remoteCallback, LocalCertSelectionCallback? localCallback) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Android.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Android.cs index ba5dc74d1d2b7..1d468dba8a574 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Android.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Android.cs @@ -7,7 +7,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { public SslConnectionInfo(SafeSslHandle sslContext) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Linux.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Linux.cs index 88472c27def2b..4bff0b9175982 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Linux.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Linux.cs @@ -6,7 +6,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { public SslConnectionInfo(SafeSslHandle sslContext) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.OSX.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.OSX.cs index ace19868dd374..67707d981aa0f 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.OSX.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.OSX.cs @@ -7,7 +7,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { public SslConnectionInfo(SafeSslHandle sslContext) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs index 6d1d5d9183686..b13ba361ff326 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs @@ -7,7 +7,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { private void MapCipherSuite(TlsCipherSuite cipherSuite) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Windows.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Windows.cs index 205526d34f39b..3741d4eaa6f12 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Windows.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Windows.cs @@ -3,7 +3,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { public SslConnectionInfo(SecPkgContext_ConnectionInfo interopConnectionInfo, TlsCipherSuite cipherSuite) { diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.cs index 28cfd1b323120..52a0b00d43bb2 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.cs @@ -3,7 +3,7 @@ namespace System.Net.Security { - internal partial class SslConnectionInfo + internal sealed partial class SslConnectionInfo { public int Protocol { get; } public TlsCipherSuite TlsCipherSuite { get; private set; } diff --git a/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfo.cs b/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfo.cs index 88403331ff2cf..29608b7254b8c 100644 --- a/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfo.cs +++ b/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfo.cs @@ -3,7 +3,7 @@ namespace System.Net { - internal class HeaderInfo + internal sealed class HeaderInfo { internal readonly bool IsRequestRestricted; internal readonly bool IsResponseRestricted; diff --git a/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfoTable.cs b/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfoTable.cs index 4e23fcc418aee..bd1bc3bd10278 100644 --- a/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfoTable.cs +++ b/src/libraries/System.Net.WebHeaderCollection/src/System/Net/HeaderInfoTable.cs @@ -7,7 +7,7 @@ namespace System.Net { - internal class HeaderInfoTable + internal sealed class HeaderInfoTable { private static readonly Func s_singleParser = value => new[] { value }; private static readonly Func s_multiParser = value => ParseValueHelper(value, isSetCookie: false); diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs index c619f92c287fd..0f50840b6fabe 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs @@ -11,7 +11,7 @@ namespace System.Collections.Generic { #region ArraySortHelper for single arrays - internal partial class ArraySortHelper + internal sealed partial class ArraySortHelper { #region IArraySortHelper Members @@ -269,7 +269,7 @@ private static void InsertionSort(Span keys, Comparison comparer) } } - internal partial class GenericArraySortHelper + internal sealed partial class GenericArraySortHelper where T : IComparable { // Do not add a constructor to this class because ArraySortHelper.CreateSortHelper will not execute it @@ -603,7 +603,7 @@ private static bool GreaterThan(ref T left, ref T right) #region ArraySortHelper for paired key and value arrays - internal partial class ArraySortHelper + internal sealed partial class ArraySortHelper { public void Sort(Span keys, Span values, IComparer? comparer) { @@ -819,7 +819,7 @@ private static void InsertionSort(Span keys, Span values, ICompare } } - internal partial class GenericArraySortHelper + internal sealed partial class GenericArraySortHelper where TKey : IComparable { public void Sort(Span keys, Span values, IComparer? comparer) diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs index 5a56d731ecbe8..efece6f4d571a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Icu.cs @@ -29,7 +29,7 @@ internal enum CalendarDataType AbbrevEraNames = 14, } - internal partial class CalendarData + internal sealed partial class CalendarData { private bool IcuLoadCalendarDataFromSystem(string localeName, CalendarId calendarId) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs index ea0bcbb802695..4f47cd2685455 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Nls.cs @@ -8,7 +8,7 @@ namespace System.Globalization { - internal partial class CalendarData + internal sealed partial class CalendarData { // Get native two digit year max internal static int NlsGetTwoDigitYearMax(CalendarId calendarId) diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs index 0834a91de7af1..22f473247620e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Unix.cs @@ -3,7 +3,7 @@ namespace System.Globalization { - internal partial class CalendarData + internal sealed partial class CalendarData { private bool LoadCalendarDataFromSystemCore(string localeName, CalendarId calendarId) => IcuLoadCalendarDataFromSystem(localeName, calendarId); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.cs index cca0fb24cfc8a..7e538c8944671 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.Windows.cs @@ -7,7 +7,7 @@ namespace System.Globalization { - internal partial class CalendarData + internal sealed partial class CalendarData { private const uint CAL_ICALINTVALUE = 0x00000001; private const uint CAL_RETURN_GENITIVE_NAMES = 0x10000000; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs index e1c1b71252012..35e493adcbc9f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CalendarData.cs @@ -12,7 +12,7 @@ namespace System.Globalization // NOTE: Calendars depend on the locale name that creates it. Only a few // properties are available without locales using CalendarData.GetCalendar(CalendarData) // - internal partial class CalendarData + internal sealed partial class CalendarData { // Max calendars internal const int MAX_CALENDARS = 23; diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs index de0bee85720ee..17e75e19cd1e7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Icu.cs @@ -7,7 +7,7 @@ namespace System.Globalization { - internal partial class CultureData + internal sealed partial class CultureData { // ICU constants private const int ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY = 100; // max size of keyword or value diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs index 5997990dd9690..be1b108e4e05c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Nls.cs @@ -10,7 +10,7 @@ namespace System.Globalization { - internal partial class CultureData + internal sealed partial class CultureData { // Wrappers around the GetLocaleInfoEx APIs which handle marshalling the returned // data as either and Int or string. diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Unix.cs index 5db6bcf1ebf25..fd59f95c76d50 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Unix.cs @@ -5,7 +5,7 @@ namespace System.Globalization { - internal partial class CultureData + internal sealed partial class CultureData { private bool InitCultureDataCore() => InitIcuCultureDataCore(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.cs index cb21ae62ac762..74854c3fd0b4a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.Windows.cs @@ -5,7 +5,7 @@ namespace System.Globalization { - internal partial class CultureData + internal sealed partial class CultureData { /// /// Check with the OS to see if this is a valid culture. diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs index b390d2fff38b9..3a013a6444646 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CultureData.cs @@ -37,7 +37,7 @@ namespace System.Globalization /// en if you pass in en /// de-DE if you pass in de-DE_phoneb /// - internal partial class CultureData + internal sealed partial class CultureData { private const int LocaleNameMaxLength = 85; private const int undef = -1; diff --git a/src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs b/src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs index b24d6dc29223c..18b714a42ce38 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Resources/ManifestBasedResourceGroveler.cs @@ -31,7 +31,7 @@ namespace System.Resources // belonging to that type may not be initialized. FrameworkEventSource.Log // is one such example. // - internal partial class ManifestBasedResourceGroveler : IResourceGroveler + internal sealed partial class ManifestBasedResourceGroveler : IResourceGroveler { private readonly ResourceManager.ResourceManagerMediator _mediator; diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderLatin1BestFitFallback.Data.cs b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderLatin1BestFitFallback.Data.cs index 5643d42d7a1fd..c110074189c19 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/EncoderLatin1BestFitFallback.Data.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/EncoderLatin1BestFitFallback.Data.cs @@ -3,7 +3,7 @@ namespace System.Text { - internal partial class EncoderLatin1BestFitFallbackBuffer + internal sealed partial class EncoderLatin1BestFitFallbackBuffer { // Best fit for ASCII, and since it works for ASCII, we use it for latin1 as well. private static readonly char[] s_arrayCharBestFit = diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Unix.cs index 758b47695af1b..fe1eaa37d7577 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Unix.cs @@ -3,7 +3,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { private struct CpuUtilizationReader { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Windows.cs index be5dc808be526..4818512ba8183 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.CpuUtilizationReader.Windows.cs @@ -6,7 +6,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { private struct CpuUtilizationReader { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.GateThread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.GateThread.cs index 99bad6108fdb3..eba5c66d7e0a3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.GateThread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.GateThread.cs @@ -8,7 +8,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { private static class GateThread { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.Complex.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.Complex.cs index 0622b4b704582..7c0fbc34ceeb0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.Complex.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.Complex.cs @@ -3,9 +3,9 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { - private partial class HillClimbing + private sealed partial class HillClimbing { private struct Complex { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.cs index d34c0dad3dd9b..aead56b38acab 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.HillClimbing.cs @@ -6,12 +6,12 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { /// /// Hill climbing algorithm used for determining the number of threads needed for the thread pool. /// - private partial class HillClimbing + private sealed partial class HillClimbing { private const int LogCapacity = 200; private const int DefaultSampleIntervalMsLow = 10; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.ThreadCounts.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.ThreadCounts.cs index 80ef3a5d4ac4c..1c0c121847387 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.ThreadCounts.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.ThreadCounts.cs @@ -6,7 +6,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { /// /// Tracks information on the number of threads we want/have in different states in our thread pool. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WaitThread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WaitThread.cs index 8a972e58e9440..bd7d3d857e0ef 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WaitThread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WaitThread.cs @@ -22,7 +22,7 @@ public CompleteWaitThreadPoolWorkItem(RegisteredWaitHandle registeredWaitHandle, } } - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { /// /// A linked list of s. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs index 190a8ef2e655a..917a1113f5963 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerThread.cs @@ -5,7 +5,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { /// /// The worker thread infastructure for the CLR thread pool. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerTracking.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerTracking.cs index 1bdcf4fe131cf..8c588965add43 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerTracking.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.WorkerTracking.cs @@ -6,7 +6,7 @@ namespace System.Threading { - internal partial class PortableThreadPool + internal sealed partial class PortableThreadPool { private CountsOfThreadsProcessingUserCallbacks _countsOfThreadsProcessingUserCallbacks; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs index bcb28ec8a364e..dc486327717cd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs @@ -582,7 +582,7 @@ public bool IsHeldByCurrentThread #region Debugger proxy class /// - /// internal sealed class used by debug type proxy attribute to display the owner thread ID + /// internal class used by debug type proxy attribute to display the owner thread ID /// internal sealed class SystemThreading_SpinLockDebugView { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs index 72ec6a7276a0c..2ab4c1003e121 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Timer.cs @@ -37,7 +37,7 @@ namespace System.Threading // in order to minimize contention when lots of threads are concurrently creating and destroying timers often. [DebuggerDisplay("Count = {CountForDebugger}")] [DebuggerTypeProxy(typeof(TimerQueueDebuggerTypeProxy))] - internal partial class TimerQueue + internal sealed partial class TimerQueue { #region Shared TimerQueue instances /// Mapping from a tick count to a time to use when debugging to translate tick count values. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Portable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Portable.cs index 40c84e4ad0fce..c1e8918803e7e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Portable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Portable.cs @@ -9,7 +9,7 @@ namespace System.Threading // // Unix-specific implementation of Timer // - internal partial class TimerQueue : IThreadPoolWorkItem + internal sealed partial class TimerQueue : IThreadPoolWorkItem { private static List? s_scheduledTimers; private static List? s_scheduledTimersToFire; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs index efc16224062b5..005fa12ca6f23 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs @@ -3,7 +3,7 @@ namespace System.Threading { - internal partial class TimerQueue + internal sealed partial class TimerQueue { private static long TickCount64 => Environment.TickCount64; } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs index 3d70db05dfd40..228cae763e262 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs @@ -5,7 +5,7 @@ namespace System.Threading { - internal partial class TimerQueue + internal sealed partial class TimerQueue { private static long TickCount64 { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Attributes.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Attributes.cs index 9da06545c254d..1367f3c0dacbf 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Attributes.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Attributes.cs @@ -5,7 +5,7 @@ namespace System.Runtime.Serialization { - internal class Attributes + internal sealed class Attributes { private static readonly XmlDictionaryString[] s_serializationLocalNames = new XmlDictionaryString[] { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/BitFlagsGenerator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/BitFlagsGenerator.cs index b1bec72dae15f..ca8c911f01296 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/BitFlagsGenerator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/BitFlagsGenerator.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization { - internal class BitFlagsGenerator + internal sealed class BitFlagsGenerator { private readonly int _bitCount; private readonly CodeGenerator _ilg; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs index 8487753423c9f..b1230c1e97808 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ClassDataContract.cs @@ -1473,7 +1473,7 @@ internal Member(DataMember member, string ns, int baseTypeIndex) internal int baseTypeIndex; } - internal class DataMemberConflictComparer : IComparer + internal sealed class DataMemberConflictComparer : IComparer { public int Compare(Member x, Member y) { @@ -1522,7 +1522,7 @@ internal ClassDataContractCriticalHelper Clone() } } - internal class DataMemberComparer : IComparer + internal sealed class DataMemberComparer : IComparer { public int Compare(DataMember? x, DataMember? y) { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs index 3362c7a7bf550..780866c355f49 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CodeGenerator.cs @@ -15,7 +15,7 @@ namespace System.Runtime.Serialization { - internal class CodeGenerator + internal sealed class CodeGenerator { private static MethodInfo? s_getTypeFromHandle; private static MethodInfo GetTypeFromHandle @@ -1496,7 +1496,7 @@ internal void ToString(Type type) } } - internal class ArgBuilder + internal sealed class ArgBuilder { internal int Index; internal Type ArgType; @@ -1507,7 +1507,7 @@ internal ArgBuilder(int index, Type argType) } } - internal class ForState + internal sealed class ForState { private readonly LocalBuilder? _indexVar; private readonly Label _beginLabel; @@ -1591,7 +1591,7 @@ internal enum Cmp GreaterThanOrEqualTo } - internal class IfState + internal sealed class IfState { private Label _elseBegin; private Label _endIf; @@ -1622,7 +1622,7 @@ internal Label ElseBegin } - internal class SwitchState + internal sealed class SwitchState { private readonly Label _defaultLabel; private readonly Label _endOfSwitchLabel; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs index f73b6e182ecc5..0c25be7988c52 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/CollectionDataContract.cs @@ -23,7 +23,7 @@ internal interface IKeyValuePairAdapter { } //Special Adapter class to serialize KeyValuePair as Dictionary needs it when polymorphism is involved [DataContract(Namespace = "http://schemas.datacontract.org/2004/07/System.Collections.Generic")] - internal class KeyValuePairAdapter : IKeyValuePairAdapter + internal sealed class KeyValuePairAdapter : IKeyValuePairAdapter { private K _kvpKey; private T _kvpValue; @@ -1546,7 +1546,7 @@ public override void WriteXmlValue(XmlWriterDelegator xmlWriter, object obj, Xml return o; } - internal class DictionaryEnumerator : IEnumerator> + internal sealed class DictionaryEnumerator : IEnumerator> { private readonly IDictionaryEnumerator _enumerator; @@ -1581,7 +1581,7 @@ public void Reset() } } - internal class GenericDictionaryEnumerator : IEnumerator> + internal sealed class GenericDictionaryEnumerator : IEnumerator> { private readonly IEnumerator> _enumerator; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs index 7d667cf1728d8..c7e2d8d8cbfa4 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs @@ -2182,7 +2182,7 @@ internal interface IGenericNameProvider bool ParametersFromBuiltInNamespaces { get; } } - internal class GenericNameProvider : IGenericNameProvider + internal sealed class GenericNameProvider : IGenericNameProvider { private readonly string _genericTypeName; private readonly object[] _genericParams; //Type or DataContract @@ -2265,7 +2265,7 @@ private XmlQualifiedName GetStableName(int i) - internal class TypeHandleRefEqualityComparer : IEqualityComparer + internal sealed class TypeHandleRefEqualityComparer : IEqualityComparer { public bool Equals(TypeHandleRef? x, TypeHandleRef? y) { @@ -2278,7 +2278,7 @@ public int GetHashCode(TypeHandleRef obj) } } - internal class TypeHandleRef + internal sealed class TypeHandleRef { private RuntimeTypeHandle _value; @@ -2304,7 +2304,7 @@ public RuntimeTypeHandle Value } } - internal class IntRef + internal sealed class IntRef { private readonly int _value; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs index 43b2ebb245674..47e6106473a1a 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataMember.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization { - internal class DataMember + internal sealed class DataMember { private readonly CriticalHelper _helper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs index b828cab0f81f3..0429b5f724603 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataObject.cs @@ -23,7 +23,7 @@ internal IList? Members } } - internal class ExtensionDataMember + internal sealed class ExtensionDataMember { private IDataNode? _value; private int _memberIndex; @@ -191,7 +191,7 @@ internal void AddQualifiedNameAttribute(ElementData element, string elementPrefi } } - internal class ClassDataNode : DataNode + internal sealed class ClassDataNode : DataNode { private IList? _members; @@ -213,7 +213,7 @@ public override void Clear() } } - internal class XmlDataNode : DataNode + internal sealed class XmlDataNode : DataNode { private IList? _xmlAttributes; private IList? _xmlChildNodes; @@ -251,7 +251,7 @@ public override void Clear() } } - internal class CollectionDataNode : DataNode + internal sealed class CollectionDataNode : DataNode { private IList? _items; private string? _itemName; @@ -302,7 +302,7 @@ public override void Clear() } } - internal class ISerializableDataNode : DataNode + internal sealed class ISerializableDataNode : DataNode { private string? _factoryTypeName; private string? _factoryTypeNamespace; @@ -347,7 +347,7 @@ public override void Clear() } } - internal class ISerializableDataMember + internal sealed class ISerializableDataMember { private IDataNode? _value; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs index 06fe919e77703..58be047a9dd09 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ExtensionDataReader.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization { // NOTE: XmlReader methods that are not needed have been left un-implemented - internal class ExtensionDataReader : XmlReader + internal sealed class ExtensionDataReader : XmlReader { private enum ExtensionDataNodeType { @@ -508,7 +508,7 @@ private static void AddPrefix(string prefix, string ns) } } - internal class AttributeData + internal sealed class AttributeData { public string? prefix; public string? ns; @@ -516,7 +516,7 @@ internal class AttributeData public string? value; } - internal class ElementData + internal sealed class ElementData { public string? localName; public string? ns; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/HybridObjectCache.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/HybridObjectCache.cs index 035f1556b67a8..d0e9f8e118785 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/HybridObjectCache.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/HybridObjectCache.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization { - internal class HybridObjectCache + internal sealed class HybridObjectCache { private Dictionary? _objectDictionary; private Dictionary? _referencedObjectDictionary; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ByteArrayHelperWithString.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ByteArrayHelperWithString.cs index 90263ce535a02..06fce438e58b6 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ByteArrayHelperWithString.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ByteArrayHelperWithString.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization.Json { - internal class ByteArrayHelperWithString : ArrayHelper + internal sealed class ByteArrayHelperWithString : ArrayHelper { public static readonly ByteArrayHelperWithString Instance = new ByteArrayHelperWithString(); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonByteArrayDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonByteArrayDataContract.cs index 19ac60805082e..b0ec7cdd07a09 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonByteArrayDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonByteArrayDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonByteArrayDataContract : JsonDataContract + internal sealed class JsonByteArrayDataContract : JsonDataContract { public JsonByteArrayDataContract(ByteArrayDataContract traditionalByteArrayDataContract) : base(traditionalByteArrayDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs index 134486ee892d7..4c4c0d33b6e32 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonClassDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonClassDataContract : JsonDataContract + internal sealed class JsonClassDataContract : JsonDataContract { private readonly JsonClassDataContractCriticalHelper _helper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs index e75db2df63c2b..13693553deb9b 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonCollectionDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonCollectionDataContract : JsonDataContract + internal sealed class JsonCollectionDataContract : JsonDataContract { private readonly JsonCollectionDataContractCriticalHelper _helper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs index f0ad3d71763c1..6482fd752639c 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonDataContract.cs @@ -298,7 +298,7 @@ private void AddCollectionItemContractsToKnownDataContracts() } } - internal class JsonReadWriteDelegates + internal sealed class JsonReadWriteDelegates { // this is the global dictionary for JSON delegates introduced for multi-file private static readonly Dictionary s_jsonDelegates = new Dictionary(); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs index 939f83ba5b23e..fa2b5ae042a80 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization.Json // This wrapper does not support seek. // Supports: UTF-8, Unicode, BigEndianUnicode // ASSUMPTION (Microsoft): This class will only be used for EITHER reading OR writing. It can be done, it would just mean more buffers. - internal class JsonEncodingStreamWrapper : Stream + internal sealed class JsonEncodingStreamWrapper : Stream { private static readonly UnicodeEncoding s_validatingBEUTF16 = new UnicodeEncoding(true, false, true); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEnumDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEnumDataContract.cs index a4917866e0e8b..f27c5361ebd90 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEnumDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEnumDataContract.cs @@ -3,7 +3,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonEnumDataContract : JsonDataContract + internal sealed class JsonEnumDataContract : JsonDataContract { private readonly JsonEnumDataContractCriticalHelper _helper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs index de12d45a397f5..e47e30fd67361 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonFormatWriterGenerator.cs @@ -17,7 +17,7 @@ namespace System.Runtime.Serialization.Json internal delegate void JsonFormatClassWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, ClassDataContract dataContract, XmlDictionaryString[]? memberNames); internal delegate void JsonFormatCollectionWriterDelegate(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContextComplexJson context, CollectionDataContract dataContract); - internal class JsonFormatWriterGenerator + internal sealed class JsonFormatWriterGenerator { private readonly CriticalHelper _helper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonObjectDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonObjectDataContract.cs index 601ddc1843198..034d57d757da0 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonObjectDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonObjectDataContract.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonObjectDataContract : JsonDataContract + internal sealed class JsonObjectDataContract : JsonDataContract { public JsonObjectDataContract(DataContract traditionalDataContract) : base(traditionalDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonQNameDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonQNameDataContract.cs index 7a9f805fee299..57c61347c83a2 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonQNameDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonQNameDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonQNameDataContract : JsonDataContract + internal sealed class JsonQNameDataContract : JsonDataContract { public JsonQNameDataContract(QNameDataContract traditionalQNameDataContract) : base(traditionalQNameDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonReaderDelegator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonReaderDelegator.cs index dd0da7e6827bc..e36a4fe304a0d 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonReaderDelegator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonReaderDelegator.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonReaderDelegator : XmlReaderDelegator + internal sealed class JsonReaderDelegator : XmlReaderDelegator { private readonly DateTimeFormat? _dateTimeFormat; private DateTimeArrayJsonHelperWithString? _dateTimeArrayHelper; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonStringDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonStringDataContract.cs index e9e1d3c5d77c4..89365be7c7626 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonStringDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonStringDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonStringDataContract : JsonDataContract + internal sealed class JsonStringDataContract : JsonDataContract { public JsonStringDataContract(StringDataContract traditionalStringDataContract) : base(traditionalStringDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonUriDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonUriDataContract.cs index 5e5605931c44f..de4dce0cf7fce 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonUriDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonUriDataContract.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonUriDataContract : JsonDataContract + internal sealed class JsonUriDataContract : JsonDataContract { public JsonUriDataContract(UriDataContract traditionalUriDataContract) : base(traditionalUriDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonWriterDelegator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonWriterDelegator.cs index 0ed5f9f7d5a4c..9c164eed11301 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonWriterDelegator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonWriterDelegator.cs @@ -6,7 +6,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonWriterDelegator : XmlWriterDelegator + internal sealed class JsonWriterDelegator : XmlWriterDelegator { private readonly DateTimeFormat? _dateTimeFormat; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonXmlDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonXmlDataContract.cs index 0dea02feddb5e..12044fb8b2ec4 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonXmlDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonXmlDataContract.cs @@ -8,7 +8,7 @@ namespace System.Runtime.Serialization.Json { - internal class JsonXmlDataContract : JsonDataContract + internal sealed class JsonXmlDataContract : JsonDataContract { public JsonXmlDataContract(XmlDataContract traditionalXmlDataContract) : base(traditionalXmlDataContract) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatWriter.cs index 3fd8d58bd346e..2c1909e007870 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/ReflectionJsonFormatWriter.cs @@ -13,7 +13,7 @@ namespace System.Runtime.Serialization.Json { - internal class ReflectionJsonFormatWriter + internal sealed class ReflectionJsonFormatWriter { private readonly ReflectionJsonClassWriter _reflectionClassWriter = new ReflectionJsonClassWriter(); @@ -188,7 +188,7 @@ private void ReflectionWriteArrayAttribute(XmlWriterDelegator xmlWriter) } } - internal class ReflectionJsonClassWriter : ReflectionClassWriter + internal sealed class ReflectionJsonClassWriter : ReflectionClassWriter { protected override int ReflectionWriteMembers(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract, ClassDataContract derivedMostClassContract, int childElementIndex, XmlDictionaryString[]? memberNames) { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs index a035f951261d4..21c6548561922 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonReader.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization.Json { - internal class XmlJsonReader : XmlBaseReader, IXmlJsonReaderInitializer + internal sealed class XmlJsonReader : XmlBaseReader, IXmlJsonReaderInitializer { private const int MaxTextChunk = 2048; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs index c87b311fbfd7c..103013f095985 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlJsonWriter.cs @@ -12,7 +12,7 @@ namespace System.Runtime.Serialization.Json { - internal class XmlJsonWriter : XmlDictionaryWriter, IXmlJsonWriterInitializer + internal sealed class XmlJsonWriter : XmlDictionaryWriter, IXmlJsonWriterInitializer { private const char BACK_SLASH = '\\'; private const char FORWARD_SLASH = '/'; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs index 39011d6f38b74..f5f9b404b46a5 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerReadContextComplexJson.cs @@ -14,7 +14,7 @@ namespace System.Runtime.Serialization.Json { - internal class XmlObjectSerializerReadContextComplexJson : XmlObjectSerializerReadContextComplex + internal sealed class XmlObjectSerializerReadContextComplexJson : XmlObjectSerializerReadContextComplex { private string? _extensionDataValueType; private readonly DateTimeFormat? _dateTimeFormat; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs index 5887dac3a8ea5..996e2c3915f93 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/XmlObjectSerializerWriteContextComplexJson.cs @@ -13,7 +13,7 @@ namespace System.Runtime.Serialization.Json { - internal class XmlObjectSerializerWriteContextComplexJson : XmlObjectSerializerWriteContextComplex + internal sealed class XmlObjectSerializerWriteContextComplexJson : XmlObjectSerializerWriteContextComplex { private readonly EmitTypeInformation _emitXsiType; private bool _perCallXsiTypeAlreadyEmitted; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ObjectToIdCache.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ObjectToIdCache.cs index dbe86840f9b9f..38b9bc57e070f 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ObjectToIdCache.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ObjectToIdCache.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Serialization { - internal class ObjectToIdCache + internal sealed class ObjectToIdCache { internal int m_currentCount; internal int[] m_ids; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs index 27d98f17f3273..4ca4a4717a3ad 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/PrimitiveDataContract.cs @@ -177,12 +177,12 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class AsmxCharDataContract : CharDataContract + internal sealed class AsmxCharDataContract : CharDataContract { internal AsmxCharDataContract() : base(DictionaryGlobals.CharLocalName, DictionaryGlobals.AsmxTypesNamespace) { } } - internal class BooleanDataContract : PrimitiveDataContract + internal sealed class BooleanDataContract : PrimitiveDataContract { public BooleanDataContract() : base(typeof(bool), DictionaryGlobals.BooleanLocalName, DictionaryGlobals.SchemaNamespace) { @@ -208,7 +208,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class SignedByteDataContract : PrimitiveDataContract + internal sealed class SignedByteDataContract : PrimitiveDataContract { public SignedByteDataContract() : base(typeof(sbyte), DictionaryGlobals.SignedByteLocalName, DictionaryGlobals.SchemaNamespace) { @@ -234,7 +234,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class UnsignedByteDataContract : PrimitiveDataContract + internal sealed class UnsignedByteDataContract : PrimitiveDataContract { public UnsignedByteDataContract() : base(typeof(byte), DictionaryGlobals.UnsignedByteLocalName, DictionaryGlobals.SchemaNamespace) { @@ -260,7 +260,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class ShortDataContract : PrimitiveDataContract + internal sealed class ShortDataContract : PrimitiveDataContract { public ShortDataContract() : base(typeof(short), DictionaryGlobals.ShortLocalName, DictionaryGlobals.SchemaNamespace) { @@ -286,7 +286,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class UnsignedShortDataContract : PrimitiveDataContract + internal sealed class UnsignedShortDataContract : PrimitiveDataContract { public UnsignedShortDataContract() : base(typeof(ushort), DictionaryGlobals.UnsignedShortLocalName, DictionaryGlobals.SchemaNamespace) { @@ -312,7 +312,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class NullPrimitiveDataContract : PrimitiveDataContract + internal sealed class NullPrimitiveDataContract : PrimitiveDataContract { public NullPrimitiveDataContract() : base(typeof(NullPrimitiveDataContract), DictionaryGlobals.EmptyString, DictionaryGlobals.EmptyString) { @@ -351,7 +351,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class IntDataContract : PrimitiveDataContract + internal sealed class IntDataContract : PrimitiveDataContract { public IntDataContract() : base(typeof(int), DictionaryGlobals.IntLocalName, DictionaryGlobals.SchemaNamespace) { @@ -377,7 +377,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class UnsignedIntDataContract : PrimitiveDataContract + internal sealed class UnsignedIntDataContract : PrimitiveDataContract { public UnsignedIntDataContract() : base(typeof(uint), DictionaryGlobals.UnsignedIntLocalName, DictionaryGlobals.SchemaNamespace) { @@ -433,32 +433,32 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class IntegerDataContract : LongDataContract + internal sealed class IntegerDataContract : LongDataContract { internal IntegerDataContract() : base(DictionaryGlobals.integerLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class PositiveIntegerDataContract : LongDataContract + internal sealed class PositiveIntegerDataContract : LongDataContract { internal PositiveIntegerDataContract() : base(DictionaryGlobals.positiveIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NegativeIntegerDataContract : LongDataContract + internal sealed class NegativeIntegerDataContract : LongDataContract { internal NegativeIntegerDataContract() : base(DictionaryGlobals.negativeIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NonPositiveIntegerDataContract : LongDataContract + internal sealed class NonPositiveIntegerDataContract : LongDataContract { internal NonPositiveIntegerDataContract() : base(DictionaryGlobals.nonPositiveIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NonNegativeIntegerDataContract : LongDataContract + internal sealed class NonNegativeIntegerDataContract : LongDataContract { internal NonNegativeIntegerDataContract() : base(DictionaryGlobals.nonNegativeIntegerLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class UnsignedLongDataContract : PrimitiveDataContract + internal sealed class UnsignedLongDataContract : PrimitiveDataContract { public UnsignedLongDataContract() : base(typeof(ulong), DictionaryGlobals.UnsignedLongLocalName, DictionaryGlobals.SchemaNamespace) { @@ -484,7 +484,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class FloatDataContract : PrimitiveDataContract + internal sealed class FloatDataContract : PrimitiveDataContract { public FloatDataContract() : base(typeof(float), DictionaryGlobals.FloatLocalName, DictionaryGlobals.SchemaNamespace) { @@ -510,7 +510,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class DoubleDataContract : PrimitiveDataContract + internal sealed class DoubleDataContract : PrimitiveDataContract { public DoubleDataContract() : base(typeof(double), DictionaryGlobals.DoubleLocalName, DictionaryGlobals.SchemaNamespace) { @@ -536,7 +536,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class DecimalDataContract : PrimitiveDataContract + internal sealed class DecimalDataContract : PrimitiveDataContract { public DecimalDataContract() : base(typeof(decimal), DictionaryGlobals.DecimalLocalName, DictionaryGlobals.SchemaNamespace) { @@ -562,7 +562,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class DateTimeDataContract : PrimitiveDataContract + internal sealed class DateTimeDataContract : PrimitiveDataContract { public DateTimeDataContract() : base(typeof(DateTime), DictionaryGlobals.DateTimeLocalName, DictionaryGlobals.SchemaNamespace) { @@ -624,107 +624,107 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class TimeDataContract : StringDataContract + internal sealed class TimeDataContract : StringDataContract { internal TimeDataContract() : base(DictionaryGlobals.timeLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class DateDataContract : StringDataContract + internal sealed class DateDataContract : StringDataContract { internal DateDataContract() : base(DictionaryGlobals.dateLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class HexBinaryDataContract : StringDataContract + internal sealed class HexBinaryDataContract : StringDataContract { internal HexBinaryDataContract() : base(DictionaryGlobals.hexBinaryLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class GYearMonthDataContract : StringDataContract + internal sealed class GYearMonthDataContract : StringDataContract { internal GYearMonthDataContract() : base(DictionaryGlobals.gYearMonthLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class GYearDataContract : StringDataContract + internal sealed class GYearDataContract : StringDataContract { internal GYearDataContract() : base(DictionaryGlobals.gYearLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class GMonthDayDataContract : StringDataContract + internal sealed class GMonthDayDataContract : StringDataContract { internal GMonthDayDataContract() : base(DictionaryGlobals.gMonthDayLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class GDayDataContract : StringDataContract + internal sealed class GDayDataContract : StringDataContract { internal GDayDataContract() : base(DictionaryGlobals.gDayLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class GMonthDataContract : StringDataContract + internal sealed class GMonthDataContract : StringDataContract { internal GMonthDataContract() : base(DictionaryGlobals.gMonthLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NormalizedStringDataContract : StringDataContract + internal sealed class NormalizedStringDataContract : StringDataContract { internal NormalizedStringDataContract() : base(DictionaryGlobals.normalizedStringLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class TokenDataContract : StringDataContract + internal sealed class TokenDataContract : StringDataContract { internal TokenDataContract() : base(DictionaryGlobals.tokenLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class LanguageDataContract : StringDataContract + internal sealed class LanguageDataContract : StringDataContract { internal LanguageDataContract() : base(DictionaryGlobals.languageLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NameDataContract : StringDataContract + internal sealed class NameDataContract : StringDataContract { internal NameDataContract() : base(DictionaryGlobals.NameLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NCNameDataContract : StringDataContract + internal sealed class NCNameDataContract : StringDataContract { internal NCNameDataContract() : base(DictionaryGlobals.NCNameLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class IDDataContract : StringDataContract + internal sealed class IDDataContract : StringDataContract { internal IDDataContract() : base(DictionaryGlobals.XSDIDLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class IDREFDataContract : StringDataContract + internal sealed class IDREFDataContract : StringDataContract { internal IDREFDataContract() : base(DictionaryGlobals.IDREFLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class IDREFSDataContract : StringDataContract + internal sealed class IDREFSDataContract : StringDataContract { internal IDREFSDataContract() : base(DictionaryGlobals.IDREFSLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class ENTITYDataContract : StringDataContract + internal sealed class ENTITYDataContract : StringDataContract { internal ENTITYDataContract() : base(DictionaryGlobals.ENTITYLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class ENTITIESDataContract : StringDataContract + internal sealed class ENTITIESDataContract : StringDataContract { internal ENTITIESDataContract() : base(DictionaryGlobals.ENTITIESLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NMTOKENDataContract : StringDataContract + internal sealed class NMTOKENDataContract : StringDataContract { internal NMTOKENDataContract() : base(DictionaryGlobals.NMTOKENLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class NMTOKENSDataContract : StringDataContract + internal sealed class NMTOKENSDataContract : StringDataContract { internal NMTOKENSDataContract() : base(DictionaryGlobals.NMTOKENSLocalName, DictionaryGlobals.SchemaNamespace) { } } - internal class ByteArrayDataContract : PrimitiveDataContract + internal sealed class ByteArrayDataContract : PrimitiveDataContract { public ByteArrayDataContract() : base(typeof(byte[]), DictionaryGlobals.ByteArrayLocalName, DictionaryGlobals.SchemaNamespace) { @@ -758,7 +758,7 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class ObjectDataContract : PrimitiveDataContract + internal sealed class ObjectDataContract : PrimitiveDataContract { public ObjectDataContract() : base(typeof(object), DictionaryGlobals.ObjectLocalName, DictionaryGlobals.SchemaNamespace) { @@ -839,7 +839,7 @@ public override void WriteXmlElement(XmlWriterDelegator writer, object? obj, Xml } } - internal class XsDurationDataContract : TimeSpanDataContract + internal sealed class XsDurationDataContract : TimeSpanDataContract { public XsDurationDataContract() : base(DictionaryGlobals.TimeSpanLocalName, DictionaryGlobals.SchemaNamespace) { } } @@ -874,12 +874,12 @@ public override void WriteXmlElement(XmlWriterDelegator xmlWriter, object? obj, } } - internal class AsmxGuidDataContract : GuidDataContract + internal sealed class AsmxGuidDataContract : GuidDataContract { internal AsmxGuidDataContract() : base(DictionaryGlobals.GuidLocalName, DictionaryGlobals.AsmxTypesNamespace) { } } - internal class UriDataContract : PrimitiveDataContract + internal sealed class UriDataContract : PrimitiveDataContract { public UriDataContract() : base(typeof(Uri), DictionaryGlobals.UriLocalName, DictionaryGlobals.SchemaNamespace) { @@ -911,7 +911,7 @@ public override void WriteXmlElement(XmlWriterDelegator writer, object? obj, Xml } } - internal class QNameDataContract : PrimitiveDataContract + internal sealed class QNameDataContract : PrimitiveDataContract { public QNameDataContract() : base(typeof(XmlQualifiedName), DictionaryGlobals.QNameLocalName, DictionaryGlobals.SchemaNamespace) { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatWriter.cs index 643f3a631001f..1e53b9f8bae61 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/ReflectionXmlFormatWriter.cs @@ -10,7 +10,7 @@ namespace System.Runtime.Serialization { - internal class ReflectionXmlFormatWriter + internal sealed class ReflectionXmlFormatWriter { private readonly ReflectionXmlClassWriter _reflectionClassWriter = new ReflectionXmlClassWriter(); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SchemaExporter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SchemaExporter.cs index 3e1b22ad958e1..c6d6daf0f4991 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SchemaExporter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SchemaExporter.cs @@ -16,7 +16,7 @@ namespace System.Runtime.Serialization { - internal class SchemaExporter + internal sealed class SchemaExporter { private readonly XmlSchemaSet _schemas; private XmlDocument? _xmlDoc; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableReader.cs index d5faeffd9ccb5..a6a66b6c44acd 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableReader.cs @@ -10,7 +10,7 @@ namespace System.Runtime.Serialization { - internal class XmlSerializableReader : XmlReader, IXmlLineInfo + internal sealed class XmlSerializableReader : XmlReader, IXmlLineInfo { private XmlReaderDelegator _xmlReader = null!; // initialized in BeginRead private int _startDepth; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableWriter.cs index f127737dfa132..8dc67936bf496 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlSerializableWriter.cs @@ -7,7 +7,7 @@ namespace System.Runtime.Serialization { - internal class XmlSerializableWriter : XmlWriter + internal sealed class XmlSerializableWriter : XmlWriter { private XmlWriter _xmlWriter = null!; // initialized in BeginWrite private int _depth; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs index c6d617d4e89d8..90e465237ed2c 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Text/Base64Encoding.cs @@ -8,7 +8,7 @@ namespace System.Text { - internal class Base64Encoding : Encoding + internal sealed class Base64Encoding : Encoding { private static ReadOnlySpan Char2val => new byte[128] // rely on C# compiler optimization to eliminate allocation { @@ -186,7 +186,7 @@ public unsafe override int GetBytes(char[] chars, int charIndex, int charCount, } } - public unsafe virtual int GetBytes(byte[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) + public unsafe int GetBytes(byte[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex) { if (chars == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException(nameof(chars))); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs index 959f916fcfaa2..2d2c21442d364 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Text/BinHexEncoding.cs @@ -6,7 +6,7 @@ namespace System.Text { - internal class BinHexEncoding : Encoding + internal sealed class BinHexEncoding : Encoding { public override int GetMaxByteCount(int charCount) { diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ArrayHelper.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ArrayHelper.cs index 76e7640138cff..1522ba1e25a95 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ArrayHelper.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ArrayHelper.cs @@ -94,7 +94,7 @@ public void WriteArray(XmlDictionaryWriter writer, string prefix, TArgument loca // Int8 is not supported since sbyte[] is non-CLS compliant, and uncommon // UniqueId is not supported since elements may be variable size strings - internal class BooleanArrayHelperWithString : ArrayHelper + internal sealed class BooleanArrayHelperWithString : ArrayHelper { public static readonly BooleanArrayHelperWithString Instance = new BooleanArrayHelperWithString(); @@ -109,7 +109,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class BooleanArrayHelperWithDictionaryString : ArrayHelper + internal sealed class BooleanArrayHelperWithDictionaryString : ArrayHelper { public static readonly BooleanArrayHelperWithDictionaryString Instance = new BooleanArrayHelperWithDictionaryString(); @@ -124,7 +124,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class Int16ArrayHelperWithString : ArrayHelper + internal sealed class Int16ArrayHelperWithString : ArrayHelper { public static readonly Int16ArrayHelperWithString Instance = new Int16ArrayHelperWithString(); @@ -139,7 +139,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class Int16ArrayHelperWithDictionaryString : ArrayHelper + internal sealed class Int16ArrayHelperWithDictionaryString : ArrayHelper { public static readonly Int16ArrayHelperWithDictionaryString Instance = new Int16ArrayHelperWithDictionaryString(); @@ -154,7 +154,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class Int32ArrayHelperWithString : ArrayHelper + internal sealed class Int32ArrayHelperWithString : ArrayHelper { public static readonly Int32ArrayHelperWithString Instance = new Int32ArrayHelperWithString(); @@ -169,7 +169,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class Int32ArrayHelperWithDictionaryString : ArrayHelper + internal sealed class Int32ArrayHelperWithDictionaryString : ArrayHelper { public static readonly Int32ArrayHelperWithDictionaryString Instance = new Int32ArrayHelperWithDictionaryString(); @@ -184,7 +184,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class Int64ArrayHelperWithString : ArrayHelper + internal sealed class Int64ArrayHelperWithString : ArrayHelper { public static readonly Int64ArrayHelperWithString Instance = new Int64ArrayHelperWithString(); @@ -199,7 +199,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class Int64ArrayHelperWithDictionaryString : ArrayHelper + internal sealed class Int64ArrayHelperWithDictionaryString : ArrayHelper { public static readonly Int64ArrayHelperWithDictionaryString Instance = new Int64ArrayHelperWithDictionaryString(); @@ -214,7 +214,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class SingleArrayHelperWithString : ArrayHelper + internal sealed class SingleArrayHelperWithString : ArrayHelper { public static readonly SingleArrayHelperWithString Instance = new SingleArrayHelperWithString(); @@ -229,7 +229,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class SingleArrayHelperWithDictionaryString : ArrayHelper + internal sealed class SingleArrayHelperWithDictionaryString : ArrayHelper { public static readonly SingleArrayHelperWithDictionaryString Instance = new SingleArrayHelperWithDictionaryString(); @@ -244,7 +244,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class DoubleArrayHelperWithString : ArrayHelper + internal sealed class DoubleArrayHelperWithString : ArrayHelper { public static readonly DoubleArrayHelperWithString Instance = new DoubleArrayHelperWithString(); @@ -259,7 +259,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class DoubleArrayHelperWithDictionaryString : ArrayHelper + internal sealed class DoubleArrayHelperWithDictionaryString : ArrayHelper { public static readonly DoubleArrayHelperWithDictionaryString Instance = new DoubleArrayHelperWithDictionaryString(); @@ -274,7 +274,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class DecimalArrayHelperWithString : ArrayHelper + internal sealed class DecimalArrayHelperWithString : ArrayHelper { public static readonly DecimalArrayHelperWithString Instance = new DecimalArrayHelperWithString(); @@ -289,7 +289,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class DecimalArrayHelperWithDictionaryString : ArrayHelper + internal sealed class DecimalArrayHelperWithDictionaryString : ArrayHelper { public static readonly DecimalArrayHelperWithDictionaryString Instance = new DecimalArrayHelperWithDictionaryString(); @@ -304,7 +304,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class DateTimeArrayHelperWithString : ArrayHelper + internal sealed class DateTimeArrayHelperWithString : ArrayHelper { public static readonly DateTimeArrayHelperWithString Instance = new DateTimeArrayHelperWithString(); @@ -319,7 +319,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class DateTimeArrayHelperWithDictionaryString : ArrayHelper + internal sealed class DateTimeArrayHelperWithDictionaryString : ArrayHelper { public static readonly DateTimeArrayHelperWithDictionaryString Instance = new DateTimeArrayHelperWithDictionaryString(); @@ -334,7 +334,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class GuidArrayHelperWithString : ArrayHelper + internal sealed class GuidArrayHelperWithString : ArrayHelper { public static readonly GuidArrayHelperWithString Instance = new GuidArrayHelperWithString(); @@ -349,7 +349,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class GuidArrayHelperWithDictionaryString : ArrayHelper + internal sealed class GuidArrayHelperWithDictionaryString : ArrayHelper { public static readonly GuidArrayHelperWithDictionaryString Instance = new GuidArrayHelperWithDictionaryString(); @@ -364,7 +364,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, Xm } } - internal class TimeSpanArrayHelperWithString : ArrayHelper + internal sealed class TimeSpanArrayHelperWithString : ArrayHelper { public static readonly TimeSpanArrayHelperWithString Instance = new TimeSpanArrayHelperWithString(); @@ -379,7 +379,7 @@ protected override void WriteArray(XmlDictionaryWriter writer, string prefix, st } } - internal class TimeSpanArrayHelperWithDictionaryString : ArrayHelper + internal sealed class TimeSpanArrayHelperWithDictionaryString : ArrayHelper { public static readonly TimeSpanArrayHelperWithDictionaryString Instance = new TimeSpanArrayHelperWithDictionaryString(); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/EncodingStreamWrapper.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/EncodingStreamWrapper.cs index 08416bf4ef91f..09af5cbd9a501 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/EncodingStreamWrapper.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/EncodingStreamWrapper.cs @@ -18,7 +18,7 @@ namespace System.Xml // ASSUMPTION (Microsoft): The byte buffer is large enough to hold the declaration // ASSUMPTION (Microsoft): The buffer manipulation methods (FillBuffer/Compare/etc.) will only be used to parse the declaration // during construction. - internal class EncodingStreamWrapper : Stream + internal sealed class EncodingStreamWrapper : Stream { private enum SupportedEncoding { UTF8, UTF16LE, UTF16BE, None } private static readonly UTF8Encoding s_safeUTF8 = new UTF8Encoding(false, false); diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/PrefixHandle.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/PrefixHandle.cs index 79742003b84f4..af24916d0dc0c 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/PrefixHandle.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/PrefixHandle.cs @@ -16,7 +16,7 @@ internal enum PrefixHandleType Max, } - internal class PrefixHandle : IEquatable + internal sealed class PrefixHandle : IEquatable { private readonly XmlBufferReader _bufferReader; private PrefixHandleType _type; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/StringHandle.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/StringHandle.cs index 07d9bbb1ddac7..eacd50236de1e 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/StringHandle.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/StringHandle.cs @@ -15,7 +15,7 @@ internal enum StringHandleConstStringType Item = 2 } - internal class StringHandle : IEquatable + internal sealed class StringHandle : IEquatable { private readonly XmlBufferReader _bufferReader; private StringHandleType _type; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ValueHandle.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ValueHandle.cs index 94a4908b414ca..f4dfdba9c84d4 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ValueHandle.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/ValueHandle.cs @@ -65,7 +65,7 @@ internal enum ValueHandleType ConstString } - internal class ValueHandle + internal sealed class ValueHandle { private readonly XmlBufferReader _bufferReader; private ValueHandleType _type; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReader.cs index 7f7e0e38ab3e7..4505fb2d23612 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryReader.cs @@ -21,7 +21,7 @@ void SetInput(Stream stream, OnXmlDictionaryReaderClose? onClose); } - internal class XmlBinaryReader : XmlBaseReader, IXmlBinaryReaderInitializer + internal sealed class XmlBinaryReader : XmlBaseReader, IXmlBinaryReaderInitializer { private bool _isTextWithEndElement; private bool _buffered; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs index c353ce30366a8..53a9d45ffce18 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBinaryWriter.cs @@ -20,7 +20,7 @@ public interface IXmlBinaryWriterInitializer void SetOutput(Stream stream, IXmlDictionary? dictionary, XmlBinaryWriterSession? session, bool ownsStream); } - internal class XmlBinaryNodeWriter : XmlStreamNodeWriter + internal sealed class XmlBinaryNodeWriter : XmlStreamNodeWriter { private IXmlDictionary? _dictionary; private XmlBinaryWriterSession? _session; @@ -1068,7 +1068,7 @@ public void WriteTo(XmlBinaryNodeWriter writer) } } - internal class XmlBinaryWriter : XmlBaseWriter, IXmlBinaryWriterInitializer + internal sealed class XmlBinaryWriter : XmlBaseWriter, IXmlBinaryWriterInitializer { private XmlBinaryNodeWriter _writer = null!; // initialized in SetOutput private char[]? _chars; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs index 20956f5a1c56d..dc124955be3bd 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlBufferReader.cs @@ -15,7 +15,7 @@ namespace System.Xml { - internal class XmlBufferReader + internal sealed class XmlBufferReader { private readonly XmlDictionaryReader _reader; private Stream? _stream; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlDictionaryAsyncCheckWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlDictionaryAsyncCheckWriter.cs index bf8e1bc8eb683..cbb815091a66a 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlDictionaryAsyncCheckWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlDictionaryAsyncCheckWriter.cs @@ -11,7 +11,7 @@ namespace System.Xml { - internal class XmlDictionaryAsyncCheckWriter : XmlDictionaryWriter + internal sealed class XmlDictionaryAsyncCheckWriter : XmlDictionaryWriter { private readonly XmlDictionaryWriter _coreWriter; private Task? _lastTask; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlSigningNodeWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlSigningNodeWriter.cs index fb539d2ac2ba1..5d25fcf4fb83f 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlSigningNodeWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlSigningNodeWriter.cs @@ -7,7 +7,7 @@ namespace System.Xml { - internal class XmlSigningNodeWriter : XmlNodeWriter + internal sealed class XmlSigningNodeWriter : XmlNodeWriter { private XmlNodeWriter _writer = null!; // initialized by SetOutput private XmlCanonicalWriter _signingWriter = null!; // initialized by SetOutput diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextReader.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextReader.cs index bfa8557cee4b8..7ddea5e25d53f 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextReader.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextReader.cs @@ -21,7 +21,7 @@ public interface IXmlTextReaderInitializer void SetInput(Stream stream, Encoding? encoding, XmlDictionaryReaderQuotas quotas, OnXmlDictionaryReaderClose? onClose); } - internal class XmlUTF8TextReader : XmlBaseReader, IXmlLineInfo, IXmlTextReaderInitializer + internal sealed class XmlUTF8TextReader : XmlBaseReader, IXmlLineInfo, IXmlTextReaderInitializer { private const int MaxTextChunk = 2048; diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs index 22e4d66296e80..34e38ec5a32d5 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlUTF8TextWriter.cs @@ -12,7 +12,7 @@ public interface IXmlTextWriterInitializer void SetOutput(Stream stream, Encoding encoding, bool ownsStream); } - internal class XmlUTF8TextWriter : XmlBaseWriter, IXmlTextWriterInitializer + internal sealed class XmlUTF8TextWriter : XmlBaseWriter, IXmlTextWriterInitializer { private XmlUTF8NodeWriter? _writer; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/BaseUriAnnotation.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/BaseUriAnnotation.cs index c61db3f8b6b7f..d690e8320eef5 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/BaseUriAnnotation.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/BaseUriAnnotation.cs @@ -3,7 +3,7 @@ namespace System.Xml.Linq { - internal class BaseUriAnnotation + internal sealed class BaseUriAnnotation { internal string baseUri; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/LineInfoEndElementAnnotation.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/LineInfoEndElementAnnotation.cs index 9dce18477049e..f82be67c2fc85 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/LineInfoEndElementAnnotation.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/LineInfoEndElementAnnotation.cs @@ -8,7 +8,7 @@ namespace System.Xml.Linq /// if that element is not empty element and we want to store the line info /// for its end element tag. /// - internal class LineInfoEndElementAnnotation : LineInfoAnnotation + internal sealed class LineInfoEndElementAnnotation : LineInfoAnnotation { public LineInfoEndElementAnnotation(int lineNumber, int linePosition) : base(lineNumber, linePosition) diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeBuilder.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeBuilder.cs index 027eafd2ba5e4..4e4164c04c326 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeBuilder.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeBuilder.cs @@ -6,7 +6,7 @@ namespace System.Xml.Linq { - internal class XNodeBuilder : XmlWriter + internal sealed class XNodeBuilder : XmlWriter { private List? _content; private XContainer? _parent; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeReader.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeReader.cs index 161386bd1d27c..2ee9abc085136 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeReader.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XNodeReader.cs @@ -5,7 +5,7 @@ namespace System.Xml.Linq { - internal class XNodeReader : XmlReader, IXmlLineInfo + internal sealed class XNodeReader : XmlReader, IXmlLineInfo { private static readonly char[] s_WhitespaceChars = new char[] { ' ', '\t', '\n', '\r' }; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeAnnotation.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeAnnotation.cs index 54409b0e11a8a..4816511a54416 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeAnnotation.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Linq/XObjectChangeAnnotation.cs @@ -3,7 +3,7 @@ namespace System.Xml.Linq { - internal class XObjectChangeAnnotation + internal sealed class XObjectChangeAnnotation { internal EventHandler? changing; internal EventHandler? changed; diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs index 5d1f1208f4138..a1c1b986df663 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/Schema/XNodeValidator.cs @@ -12,7 +12,7 @@ namespace System.Xml.Schema { - internal class XNodeValidator + internal sealed class XNodeValidator { private readonly XmlSchemaSet schemas; private readonly ValidationEventHandler? validationEventHandler; @@ -379,7 +379,7 @@ private void ValidationCallback(object? sender, ValidationEventArgs e) } } - internal class XmlSchemaInfoEqualityComparer : IEqualityComparer + internal sealed class XmlSchemaInfoEqualityComparer : IEqualityComparer { public bool Equals(XmlSchemaInfo? si1, XmlSchemaInfo? si2) { diff --git a/src/libraries/System.Private.Xml.Linq/src/System/Xml/XPath/XNodeNavigator.cs b/src/libraries/System.Private.Xml.Linq/src/System/Xml/XPath/XNodeNavigator.cs index 2455ff886c3cc..074dd99d4a9db 100644 --- a/src/libraries/System.Private.Xml.Linq/src/System/Xml/XPath/XNodeNavigator.cs +++ b/src/libraries/System.Private.Xml.Linq/src/System/Xml/XPath/XNodeNavigator.cs @@ -8,7 +8,7 @@ namespace System.Xml.XPath { - internal class XNodeNavigator : XPathNavigator, IXmlLineInfo + internal sealed class XNodeNavigator : XPathNavigator, IXmlLineInfo { internal static readonly string xmlPrefixNamespace = XNamespace.Xml.NamespaceName; internal static readonly string xmlnsPrefixNamespace = XNamespace.Xmlns.NamespaceName; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Base64Decoder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Base64Decoder.cs index d21d89e9e6ae7..e7ec9664f1939 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Base64Decoder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Base64Decoder.cs @@ -5,7 +5,7 @@ namespace System.Xml { - internal class Base64Decoder : IncrementalReadDecoder + internal sealed class Base64Decoder : IncrementalReadDecoder { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Base64Encoder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Base64Encoder.cs index 1e2212ab4d2c3..18d72d4778367 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Base64Encoder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Base64Encoder.cs @@ -105,7 +105,7 @@ internal void Flush() } } - internal partial class XmlRawWriterBase64Encoder : Base64Encoder + internal sealed partial class XmlRawWriterBase64Encoder : Base64Encoder { private readonly XmlRawWriter _rawWriter; @@ -120,7 +120,7 @@ internal override void WriteChars(char[] chars, int index, int count) } } - internal partial class XmlTextWriterBase64Encoder : Base64Encoder + internal sealed partial class XmlTextWriterBase64Encoder : Base64Encoder { private readonly XmlTextEncoder _xmlTextEncoder; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Base64EncoderAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Base64EncoderAsync.cs index 3c7f28c78a9dd..233b1a5044a39 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Base64EncoderAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Base64EncoderAsync.cs @@ -95,7 +95,7 @@ internal async Task FlushAsync() } } - internal partial class XmlTextWriterBase64Encoder : Base64Encoder + internal sealed partial class XmlTextWriterBase64Encoder : Base64Encoder { internal override Task WriteCharsAsync(char[] chars, int index, int count) { @@ -103,7 +103,7 @@ internal override Task WriteCharsAsync(char[] chars, int index, int count) } } - internal partial class XmlRawWriterBase64Encoder : Base64Encoder + internal sealed partial class XmlRawWriterBase64Encoder : Base64Encoder { internal override Task WriteCharsAsync(char[] chars, int index, int count) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/BinHexDecoder.cs b/src/libraries/System.Private.Xml/src/System/Xml/BinHexDecoder.cs index 32ca96a647d6e..90a9359058044 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/BinHexDecoder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/BinHexDecoder.cs @@ -6,7 +6,7 @@ namespace System.Xml { - internal class BinHexDecoder : IncrementalReadDecoder + internal sealed class BinHexDecoder : IncrementalReadDecoder { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/BitStack.cs b/src/libraries/System.Private.Xml/src/System/Xml/BitStack.cs index b621a0037e09d..5482a325b88fa 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/BitStack.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/BitStack.cs @@ -9,7 +9,7 @@ namespace System.Xml /// /// Manages a stack of bits. Exposes push, pop, and peek operations. /// - internal class BitStack + internal sealed class BitStack { private uint[]? _bitStack; private int _stackPos; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/ByteStack.cs b/src/libraries/System.Private.Xml/src/System/Xml/ByteStack.cs index 4314b0cc8ecec..89b44fb79db4f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/ByteStack.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/ByteStack.cs @@ -12,7 +12,7 @@ namespace System.Xml // so that next time Push() is called it simply returns the last // object that was already on the stack. - internal class ByteStack + internal sealed class ByteStack { private byte[] _stack; private readonly int _growthRate; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentIterator.cs index fd68a47141d07..80c4ab6d2df75 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentIterator.cs @@ -52,7 +52,7 @@ public override int CurrentPosition /// /// Iterate over all element children with a particular QName. /// - internal class XPathDocumentElementChildIterator : XPathDocumentBaseIterator + internal sealed class XPathDocumentElementChildIterator : XPathDocumentBaseIterator { private readonly string? _localName; private readonly string _namespaceUri; @@ -110,7 +110,7 @@ public override bool MoveNext() /// /// Iterate over all content children with a particular XPathNodeType. /// - internal class XPathDocumentKindChildIterator : XPathDocumentBaseIterator + internal sealed class XPathDocumentKindChildIterator : XPathDocumentBaseIterator { private readonly XPathNodeType _typ; @@ -163,7 +163,7 @@ public override bool MoveNext() /// /// Iterate over all element descendants with a particular QName. /// - internal class XPathDocumentElementDescendantIterator : XPathDocumentBaseIterator + internal sealed class XPathDocumentElementDescendantIterator : XPathDocumentBaseIterator { private readonly XPathDocumentNavigator? _end; private readonly string? _localName; @@ -236,7 +236,7 @@ public override bool MoveNext() /// /// Iterate over all content descendants with a particular XPathNodeType. /// - internal class XPathDocumentKindDescendantIterator : XPathDocumentBaseIterator + internal sealed class XPathDocumentKindDescendantIterator : XPathDocumentBaseIterator { private readonly XPathDocumentNavigator? _end; private readonly XPathNodeType _typ; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/CharEntityEncoderFallback.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/CharEntityEncoderFallback.cs index c7b9b6315af08..cfbdc9e8a0d53 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/CharEntityEncoderFallback.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/CharEntityEncoderFallback.cs @@ -10,7 +10,7 @@ namespace System.Xml // // CharEntityEncoderFallback // - internal class CharEntityEncoderFallback : EncoderFallback + internal sealed class CharEntityEncoderFallback : EncoderFallback { private CharEntityEncoderFallbackBuffer? _fallbackBuffer; @@ -78,7 +78,7 @@ internal bool CanReplaceAt(int index) // // CharEntityFallbackBuffer // - internal class CharEntityEncoderFallbackBuffer : EncoderFallbackBuffer + internal sealed class CharEntityEncoderFallbackBuffer : EncoderFallbackBuffer { private readonly CharEntityEncoderFallback _parent; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs index 55bf9134f9094..b4210f187a411 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs @@ -786,7 +786,7 @@ private void OutputRestAmps() // // 4). SE SC same as above EE a). check stored blockPro // b). true: indentLevel no change - internal class HtmlEncodedRawTextWriterIndent : HtmlEncodedRawTextWriter + internal sealed class HtmlEncodedRawTextWriterIndent : HtmlEncodedRawTextWriter { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs index 55294ffdd97ea..2d3597534cb58 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs @@ -763,7 +763,7 @@ private void OutputRestAmps() // // 4). SE SC same as above EE a). check stored blockPro // b). true: indentLevel no change - internal class HtmlUtf8RawTextWriterIndent : HtmlUtf8RawTextWriter + internal sealed class HtmlUtf8RawTextWriterIndent : HtmlUtf8RawTextWriter { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/IncrementalReadDecoders.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/IncrementalReadDecoders.cs index 804790302addd..0db640ed5520e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/IncrementalReadDecoders.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/IncrementalReadDecoders.cs @@ -22,7 +22,7 @@ internal abstract class IncrementalReadDecoder // // Dummy IncrementalReadDecoder // - internal class IncrementalReadDummyDecoder : IncrementalReadDecoder + internal sealed class IncrementalReadDummyDecoder : IncrementalReadDecoder { internal override int DecodedCount { get { return -1; } } internal override bool IsFull { get { return false; } } @@ -35,7 +35,7 @@ internal override void Reset() { } // // IncrementalReadDecoder for ReadChars // - internal class IncrementalReadCharsDecoder : IncrementalReadDecoder + internal sealed class IncrementalReadCharsDecoder : IncrementalReadDecoder { private char[]? _buffer; private int _startIndex; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs index 1c6a61c43beb3..8bc1f54dc8b50 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/LocalAppContextSwitches.cs @@ -5,7 +5,7 @@ namespace System { - internal partial class LocalAppContextSwitches + internal static partial class LocalAppContextSwitches { private static int s_dontThrowOnInvalidSurrogatePairs; public static bool DontThrowOnInvalidSurrogatePairs diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriter.cs index 86e8bd878a676..48f952a9e513f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriter.cs @@ -19,7 +19,7 @@ namespace System.Xml /// /// It also performs well-formed document checks if standalone="yes" and/or a doc-type-decl is output. /// - internal class QueryOutputWriter : XmlRawWriter + internal sealed class QueryOutputWriter : XmlRawWriter { private readonly XmlRawWriter _wrapped; private bool _inCDataSection; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriterV1.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriterV1.cs index 88cf3c9f91571..02288d196166e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriterV1.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/QueryOutputWriterV1.cs @@ -20,7 +20,7 @@ namespace System.Xml /// It also calls WriteStateDocument if standalone="yes" and/or a DocType declaration is written out in order to enforce document conformance /// checking. /// - internal class QueryOutputWriterV1 : XmlWriter + internal sealed class QueryOutputWriterV1 : XmlWriter { private readonly XmlWriter _wrapped; private bool _inCDataSection; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs index 043e9118ec91b..99ca6edc3049a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs @@ -5,7 +5,7 @@ namespace System.Xml { - internal partial class ReadContentAsBinaryHelper + internal sealed partial class ReadContentAsBinaryHelper { // Private enums private enum State diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs index 9b2492bebc40b..8a596529f426e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs @@ -6,7 +6,7 @@ namespace System.Xml { - internal partial class ReadContentAsBinaryHelper + internal sealed partial class ReadContentAsBinaryHelper { // Internal methods diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadOnlyTernaryTree.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadOnlyTernaryTree.cs index 5b0d0ea23deba..f345e151b61cb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadOnlyTernaryTree.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadOnlyTernaryTree.cs @@ -27,7 +27,7 @@ internal enum AttributeProperties : uint { DEFAULT = 0, URI = 1, BOOLEAN = 2, NA * * Note: Only strings composed of ASCII characters can exist in the tree. */ - internal class TernaryTreeReadOnly + internal sealed class TernaryTreeReadOnly { private readonly byte[] _nodeBuffer; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/TextEncodedRawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/TextEncodedRawTextWriter.cs index 113c95cec4fa0..04be69b71795a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/TextEncodedRawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/TextEncodedRawTextWriter.cs @@ -19,7 +19,7 @@ namespace System.Xml // Encoder class to output to any encoding. The TextUtf8RawTextWriter class combined the encoding // operation with serialization in order to achieve better performance. // - internal class TextEncodedRawTextWriter : XmlEncodedRawTextWriter + internal sealed class TextEncodedRawTextWriter : XmlEncodedRawTextWriter { // Construct an instance of this class that outputs text to the TextWriter interface. public TextEncodedRawTextWriter(TextWriter writer, XmlWriterSettings settings) : base(writer, settings) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/TextUtf8RawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/TextUtf8RawTextWriter.cs index f0b317f3d54b8..a2efd3f57f46d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/TextUtf8RawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/TextUtf8RawTextWriter.cs @@ -19,7 +19,7 @@ namespace System.Xml // Encoder class to output to any encoding. The TextUtf8RawTextWriter class combined the encoding // operation with serialization in order to achieve better performance. // - internal class TextUtf8RawTextWriter : XmlUtf8RawTextWriter + internal sealed class TextUtf8RawTextWriter : XmlUtf8RawTextWriter { // Construct an instance of this class that serializes to a Stream interface. public TextUtf8RawTextWriter(Stream stream, XmlWriterSettings settings) : base(stream, settings) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ValidatingReaderNodeData.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ValidatingReaderNodeData.cs index 74d47994fbb59..f6fef4cb4beb6 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ValidatingReaderNodeData.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ValidatingReaderNodeData.cs @@ -12,7 +12,7 @@ namespace System.Xml { - internal class ValidatingReaderNodeData + internal sealed class ValidatingReaderNodeData { private string _localName; private string _namespaceUri; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckReader.cs index 1569a36b4d36f..3a1764e5b2c3f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckReader.cs @@ -914,7 +914,7 @@ public override Task ReadOuterXmlAsync() #endregion } - internal class XmlAsyncCheckReaderWithNS : XmlAsyncCheckReader, IXmlNamespaceResolver + internal sealed class XmlAsyncCheckReaderWithNS : XmlAsyncCheckReader, IXmlNamespaceResolver { private readonly IXmlNamespaceResolver _readerAsIXmlNamespaceResolver; @@ -1004,7 +1004,7 @@ IDictionary IXmlNamespaceResolver.GetNamespacesInScope(XmlNamesp #endregion } - internal class XmlAsyncCheckReaderWithLineInfoNSSchema : XmlAsyncCheckReaderWithLineInfoNS, IXmlSchemaInfo + internal sealed class XmlAsyncCheckReaderWithLineInfoNSSchema : XmlAsyncCheckReaderWithLineInfoNS, IXmlSchemaInfo { private readonly IXmlSchemaInfo _readerAsIXmlSchemaInfo; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckWriter.cs index d96b1b1621dbb..fb59fb91910c2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAsyncCheckWriter.cs @@ -6,7 +6,7 @@ namespace System.Xml { - internal class XmlAsyncCheckWriter : XmlWriter + internal sealed class XmlAsyncCheckWriter : XmlWriter { private readonly XmlWriter _coreWriter; private Task _lastTask = Task.CompletedTask; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAutoDetectWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAutoDetectWriter.cs index 78b163d37906b..70d649f86b615 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAutoDetectWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlAutoDetectWriter.cs @@ -16,7 +16,7 @@ namespace System.Xml /// This writer implements XmlOutputMethod.AutoDetect. If the first element is "html", then output will be /// directed to an Html writer. Otherwise, output will be directed to an Xml writer. /// - internal class XmlAutoDetectWriter : XmlRawWriter, IRemovableWriter + internal sealed class XmlAutoDetectWriter : XmlRawWriter, IRemovableWriter { private XmlRawWriter? _wrapped; private OnRemoveWriter? _onRemove; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingReader.cs index 2f9708a1131e0..38d606efedb80 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingReader.cs @@ -663,7 +663,7 @@ private void FinishReadBinary() // // XmlCharCheckingReaderWithNS // - internal class XmlCharCheckingReaderWithNS : XmlCharCheckingReader, IXmlNamespaceResolver + internal sealed class XmlCharCheckingReaderWithNS : XmlCharCheckingReader, IXmlNamespaceResolver { internal IXmlNamespaceResolver readerAsNSResolver; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriter.cs index f3cb979c70f0e..2174c3017b124 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriter.cs @@ -14,7 +14,7 @@ namespace System.Xml // // XmlCharCheckingWriter // - internal partial class XmlCharCheckingWriter : XmlWrappingWriter + internal sealed partial class XmlCharCheckingWriter : XmlWrappingWriter { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriterAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriterAsync.cs index 8d3b8c4934d85..dc58522f067f4 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriterAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlCharCheckingWriterAsync.cs @@ -15,7 +15,7 @@ namespace System.Xml // // XmlCharCheckingWriter // - internal partial class XmlCharCheckingWriter : XmlWrappingWriter + internal sealed partial class XmlCharCheckingWriter : XmlWrappingWriter { public override Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs index a25a9f08501aa..e03320af38639 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs @@ -13,7 +13,7 @@ namespace System.Xml // // This class does special handling of text content for XML. For example // it will replace special characters with entities whenever necessary. - internal class XmlTextEncoder + internal sealed class XmlTextEncoder { // // Fields diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.Unix.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.Unix.cs index 4321e78151e17..a1605b1c4ada2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.Unix.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.Unix.cs @@ -5,7 +5,7 @@ namespace System.Xml { - internal partial class XmlTextReaderImpl + internal sealed partial class XmlTextReaderImpl { static partial void ConvertAbsoluteUnixPathToAbsoluteUri([NotNullIfNotNull("url")] ref string? url, XmlResolver? resolver) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs index e7aba48543b30..d8e0f167f8970 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs @@ -14,7 +14,7 @@ namespace System.Xml { - internal partial class XmlTextReaderImpl : XmlReader, IXmlLineInfo, IXmlNamespaceResolver + internal sealed partial class XmlTextReaderImpl : XmlReader, IXmlLineInfo, IXmlNamespaceResolver { private static UTF8Encoding? s_utf8BomThrowing; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs index 646b3309d7c09..06dfee97fbd89 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs @@ -17,7 +17,7 @@ namespace System.Xml { - internal partial class XmlTextReaderImpl : XmlReader, IXmlLineInfo, IXmlNamespaceResolver + internal sealed partial class XmlTextReaderImpl : XmlReader, IXmlLineInfo, IXmlNamespaceResolver { private void CheckAsyncCall() { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpers.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpers.cs index 065504afdbbc0..c2feee7131890 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpers.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpers.cs @@ -15,7 +15,7 @@ namespace System.Xml { - internal partial class XmlTextReaderImpl + internal sealed partial class XmlTextReaderImpl { // // ParsingState @@ -164,7 +164,7 @@ public override void RemoveNamespace(string prefix, string uri) { } // // DtdParserProxy: IDtdParserAdapter proxy for XmlTextReaderImpl // - internal partial class DtdParserProxy : IDtdParserAdapterV1 + internal sealed partial class DtdParserProxy : IDtdParserAdapterV1 { // Fields private readonly XmlTextReaderImpl _reader; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpersAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpersAsync.cs index e877cf316e079..f6f2d8c60e2f5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpersAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplHelpersAsync.cs @@ -16,12 +16,12 @@ namespace System.Xml { - internal partial class XmlTextReaderImpl + internal sealed partial class XmlTextReaderImpl { // // DtdParserProxy: IDtdParserAdapter proxy for XmlTextReaderImpl // - internal partial class DtdParserProxy : IDtdParserAdapterV1 + internal sealed partial class DtdParserProxy : IDtdParserAdapterV1 { Task IDtdParserAdapter.ReadDataAsync() { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs index 5cf5a335aa40e..2006ae0562110 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs @@ -32,7 +32,7 @@ private enum ParsingFunction None, } - internal class ValidationEventHandling : IValidationEventHandling + internal sealed class ValidationEventHandling : IValidationEventHandling { // Fields private readonly XmlValidatingReaderImpl _reader; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs index 1b1471ae6ae7b..f4ff03f0bf01d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriter.cs @@ -12,7 +12,7 @@ namespace System.Xml { - internal partial class XmlWellFormedWriter : XmlWriter + internal sealed partial class XmlWellFormedWriter : XmlWriter { // // Private types used by the XmlWellFormedWriter are defined in XmlWellFormedWriterHelpers.cs diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs index 20c3a31f29cf5..0e3ef48bc3acc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterAsync.cs @@ -17,7 +17,7 @@ namespace System.Xml { - internal partial class XmlWellFormedWriter : XmlWriter + internal sealed partial class XmlWellFormedWriter : XmlWriter { public override Task WriteStartDocumentAsync() { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs index e869d817ee1f5..e905d9663c363 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpers.cs @@ -9,7 +9,7 @@ namespace System.Xml { - internal partial class XmlWellFormedWriter : XmlWriter + internal sealed partial class XmlWellFormedWriter : XmlWriter { // // Private types @@ -146,7 +146,7 @@ private enum SpecialAttribute XmlLang } - private partial class AttributeValueCache + private sealed partial class AttributeValueCache { private enum ItemType { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpersAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpersAsync.cs index 36b337574fb38..fb81eb472358c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpersAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlWellFormedWriterHelpersAsync.cs @@ -10,7 +10,7 @@ namespace System.Xml { - internal partial class XmlWellFormedWriter : XmlWriter + internal sealed partial class XmlWellFormedWriter : XmlWriter { private partial struct ElementScope { @@ -50,7 +50,7 @@ internal async Task WriteDeclAsync(XmlWriter writer, XmlRawWriter? rawWriter) } } - private partial class AttributeValueCache + private sealed partial class AttributeValueCache { internal async Task ReplayAsync(XmlWriter writer) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs index a5a87a9a41ad7..f363a07f02f41 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReader.cs @@ -12,7 +12,7 @@ namespace System.Xml { - internal partial class XsdCachingReader : XmlReader, IXmlLineInfo + internal sealed partial class XsdCachingReader : XmlReader, IXmlLineInfo { private enum CachingReaderState { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReaderAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReaderAsync.cs index 50123abbbf0f6..211b27d067995 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReaderAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdCachingReaderAsync.cs @@ -13,7 +13,7 @@ namespace System.Xml { - internal partial class XsdCachingReader : XmlReader, IXmlLineInfo + internal sealed partial class XsdCachingReader : XmlReader, IXmlLineInfo { // Gets the text value of the current node. public override Task GetValueAsync() diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs index cfdb657bd9055..294b174638b79 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReader.cs @@ -16,7 +16,7 @@ namespace System.Xml { internal delegate void CachingEventHandler(XsdCachingReader cachingReader); - internal class AttributePSVIInfo + internal sealed class AttributePSVIInfo { internal string? localName; internal string? namespaceUri; @@ -37,7 +37,7 @@ internal void Reset() } } - internal partial class XsdValidatingReader : XmlReader, IXmlSchemaInfo, IXmlLineInfo, IXmlNamespaceResolver + internal sealed partial class XsdValidatingReader : XmlReader, IXmlSchemaInfo, IXmlLineInfo, IXmlNamespaceResolver { private enum ValidatingReaderState { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReaderAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReaderAsync.cs index daa599cecf443..028d16b16827b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReaderAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XsdValidatingReaderAsync.cs @@ -15,7 +15,7 @@ namespace System.Xml { - internal partial class XsdValidatingReader : XmlReader, IXmlSchemaInfo, IXmlLineInfo, IXmlNamespaceResolver + internal sealed partial class XsdValidatingReader : XmlReader, IXmlSchemaInfo, IXmlLineInfo, IXmlNamespaceResolver { // Gets the text value of the current node. public override Task GetValueAsync() diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/DomNameTable.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/DomNameTable.cs index 748f0c3d0b278..069d4d564d9d8 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/DomNameTable.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/DomNameTable.cs @@ -7,7 +7,7 @@ namespace System.Xml { - internal class DomNameTable + internal sealed class DomNameTable { private XmlName[] _entries; private int _count; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XPathNodeList.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XPathNodeList.cs index 11c01d42464f1..ab098fb8b771c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XPathNodeList.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XPathNodeList.cs @@ -8,7 +8,7 @@ namespace System.Xml using System.Collections; using System.Collections.Generic; - internal class XPathNodeList : XmlNodeList + internal sealed class XPathNodeList : XmlNodeList { private readonly List _list; private readonly XPathNodeIterator _nodeIterator; @@ -83,7 +83,7 @@ public override IEnumerator GetEnumerator() } } - internal class XmlNodeListEnumerator : IEnumerator + internal sealed class XmlNodeListEnumerator : IEnumerator { private readonly XPathNodeList _list; private int _index; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlChildNodes.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlChildNodes.cs index d696646e9540e..c6e3b1e3ac629 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlChildNodes.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlChildNodes.cs @@ -5,7 +5,7 @@ namespace System.Xml { - internal class XmlChildNodes : XmlNodeList + internal sealed class XmlChildNodes : XmlNodeList { private readonly XmlNode _container; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDomTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDomTextWriter.cs index daa4156695673..1ccfffdd75261 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDomTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDomTextWriter.cs @@ -9,7 +9,7 @@ namespace System.Xml // Represents a writer that will make it possible to work with prefixes even // if the namespace is not specified. // This is not possible with XmlTextWriter. But this class inherits XmlTextWriter. - internal class XmlDOMTextWriter : XmlTextWriter + internal sealed class XmlDOMTextWriter : XmlTextWriter { public XmlDOMTextWriter(Stream w, Encoding? encoding) : base(w, encoding) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlElementList.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlElementList.cs index a809e4b2f701a..1ba414135acae 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlElementList.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlElementList.cs @@ -6,7 +6,7 @@ namespace System.Xml { - internal class XmlElementList : XmlNodeList + internal sealed class XmlElementList : XmlNodeList { private readonly string _asterisk = null!; private int _changeCount; //recording the total number that the dom tree has been changed ( insertion and deletion ) @@ -280,7 +280,7 @@ protected override void PrivateDisposeNodeList() Dispose(true); } - protected virtual void Dispose(bool disposing) + private void Dispose(bool disposing) { if (_listener != null) { @@ -294,7 +294,7 @@ protected virtual void Dispose(bool disposing) } } - internal class XmlElementListEnumerator : IEnumerator + internal sealed class XmlElementListEnumerator : IEnumerator { private readonly XmlElementList _list; private XmlNode? _curElem; @@ -334,7 +334,7 @@ public object? Current } } - internal class XmlEmptyElementListEnumerator : IEnumerator + internal sealed class XmlEmptyElementListEnumerator : IEnumerator { public XmlEmptyElementListEnumerator(XmlElementList list) { @@ -355,7 +355,7 @@ public object? Current } } - internal class XmlElementListListener + internal sealed class XmlElementListListener { private WeakReference? _elemList; private readonly XmlDocument _doc; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlLoader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlLoader.cs index 75145a14e671d..bb9ad265843a3 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlLoader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlLoader.cs @@ -10,7 +10,7 @@ namespace System.Xml { - internal class XmlLoader + internal sealed class XmlLoader { private XmlDocument? _doc; private XmlReader? _reader; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs index 705ad125aafb2..5bd07229e5184 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlNodeReader.cs @@ -12,7 +12,7 @@ namespace System.Xml using System.Xml.Schema; using System.Globalization; - internal class XmlNodeReaderNavigator + internal sealed class XmlNodeReaderNavigator { private XmlNode _curNode; private XmlNode? _elemNode; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlUnspecifiedAttribute.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlUnspecifiedAttribute.cs index a98cd608e0d13..4e5ffc51f176f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlUnspecifiedAttribute.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlUnspecifiedAttribute.cs @@ -3,12 +3,12 @@ namespace System.Xml { - internal class XmlUnspecifiedAttribute : XmlAttribute + internal sealed class XmlUnspecifiedAttribute : XmlAttribute { private bool _fSpecified; - protected internal XmlUnspecifiedAttribute(string? prefix, string localName, string? namespaceURI, XmlDocument doc) + internal XmlUnspecifiedAttribute(string? prefix, string localName, string? namespaceURI, XmlDocument doc) : base(prefix, localName, namespaceURI, doc) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/HWStack.cs b/src/libraries/System.Private.Xml/src/System/Xml/HWStack.cs index 7ba3e31f4d514..c87e8a89e5bc0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/HWStack.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/HWStack.cs @@ -12,7 +12,7 @@ namespace System.Xml // so that next time Push() is called it simply returns the last // object that was already on the stack. - internal class HWStack : ICloneable + internal sealed class HWStack : ICloneable { internal HWStack(int GrowthRate) : this(GrowthRate, int.MaxValue) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/IXmlLineInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/IXmlLineInfo.cs index 87246bb3258e6..b0e643eda6ee1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/IXmlLineInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/IXmlLineInfo.cs @@ -30,7 +30,7 @@ public static PositionInfo GetPositionInfo(object o) } } - internal class ReaderPositionInfo : PositionInfo + internal sealed class ReaderPositionInfo : PositionInfo { private readonly IXmlLineInfo _lineInfo; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/MTNameTable.cs b/src/libraries/System.Private.Xml/src/System/Xml/MTNameTable.cs index b10c97ca25fce..2ba73b0e3de37 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/MTNameTable.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/MTNameTable.cs @@ -599,7 +599,7 @@ private static Int64 Hash(char[] key, int start, int len) { // A MTNameTable node. - internal class MTNameTableNode { + internal sealed class MTNameTableNode { internal String value; internal Int64 hash; internal Int64 counter; @@ -676,7 +676,7 @@ private Int64 Compare(Int64 hash, char[] key, int start, int len) { // Enumerates all the names (strings) of a MTNameTable - internal class MTNameTableEnumerator: IEnumerator { + internal sealed class MTNameTableEnumerator: IEnumerator { private ArrayList names; private int iName; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Asttree.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Asttree.cs index 277e7045124ad..e510b22373784 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Asttree.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Asttree.cs @@ -18,7 +18,7 @@ namespace System.Xml.Schema // stack element class // this one needn't change, even the parameter in methods - internal class AxisElement + internal sealed class AxisElement { internal DoubleLinkAxis curNode; // current under-checking node during navigating internal int rootDepth; // root depth -- contextDepth + 1 if ! isDss; context + {1...} if isDss @@ -136,7 +136,7 @@ internal bool MoveToChild(string name, string? URN, int depth, ForwardAxis paren } } - internal class AxisStack + internal sealed class AxisStack { // property private readonly ArrayList _stack; // of AxisElement @@ -404,7 +404,7 @@ public bool MoveToAttribute(string localname, string? URN) * ---------------------------------------------------------------------------------------------- */ // each node in the xpath tree - internal class DoubleLinkAxis : Axis + internal sealed class DoubleLinkAxis : Axis { internal Axis? next; @@ -444,7 +444,7 @@ internal DoubleLinkAxis(Axis axis, DoubleLinkAxis? inputaxis) // only keep axis, rootNode, isAttribute, isDss inside // act as an element tree for the Asttree - internal class ForwardAxis + internal sealed class ForwardAxis { // Axis tree private readonly DoubleLinkAxis _topNode; @@ -497,7 +497,7 @@ public ForwardAxis(DoubleLinkAxis axis, bool isdesorself) } // static, including an array of ForwardAxis (this is the whole picture) - internal class Asttree + internal sealed class Asttree { // set private then give out only get access, to keep it intact all along private ArrayList _fAxisArray = null!; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/AutoValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/AutoValidator.cs index eb87b34495f88..ff86563f69112 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/AutoValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/AutoValidator.cs @@ -8,7 +8,7 @@ namespace System.Xml.Schema #pragma warning disable 618 - internal class AutoValidator : BaseValidator + internal sealed class AutoValidator : BaseValidator { public AutoValidator(XmlValidatingReaderImpl reader, XmlSchemaCollection schemaCollection, IValidationEventHandling eventHandling) : base(reader, schemaCollection, eventHandling) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Chameleonkey.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Chameleonkey.cs index a147f5a964777..d90325692b779 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Chameleonkey.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Chameleonkey.cs @@ -11,7 +11,7 @@ namespace System.Xml.Schema { // Case insensitive file name key for use in a hashtable. - internal class ChameleonKey + internal sealed class ChameleonKey { internal string targetNS; internal Uri chameleonLocation; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/CompiledidEntityConstraint.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/CompiledidEntityConstraint.cs index 7370dd125e2a3..586c0a49d17ff 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/CompiledidEntityConstraint.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/CompiledidEntityConstraint.cs @@ -9,7 +9,7 @@ namespace System.Xml.Schema using System.Xml.XPath; using MS.Internal.Xml.XPath; - internal class CompiledIdentityConstraint + internal sealed class CompiledIdentityConstraint { internal XmlQualifiedName name = XmlQualifiedName.Empty; private readonly ConstraintRole _role; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/ConstraintStruct.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/ConstraintStruct.cs index c953d3af3d682..badf0548d9181 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/ConstraintStruct.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/ConstraintStruct.cs @@ -41,7 +41,7 @@ internal ConstraintStruct(CompiledIdentityConstraint constraint) } // ActiveAxis plus the location plus the state of matching in the constraint table : only for field - internal class LocatedActiveAxis : ActiveAxis + internal sealed class LocatedActiveAxis : ActiveAxis { private readonly int _column; // the column in the table (the field sequence) internal bool isMatched; // if it's matched, then fill value in the validator later @@ -76,7 +76,7 @@ internal void Reactivate(KeySequence ks) // 6. taking care of updating ConstraintStruct.axisFields // 7. remove constraintTable from ConstraintStruct // 8. still need centralized locatedactiveaxis for movetoattribute purpose - internal class SelectorActiveAxis : ActiveAxis + internal sealed class SelectorActiveAxis : ActiveAxis { private readonly ConstraintStruct _cs; // pointer of constraintstruct, to enable 6 private readonly ArrayList _KSs; // stack of KSStruct, will not become less @@ -145,7 +145,7 @@ public KeySequence PopKS() } } - internal class KSStruct + internal sealed class KSStruct { public int depth; // depth of selector when it matches public KeySequence ks; // ks of selector when it matches and assigned -- needs to new each time @@ -158,7 +158,7 @@ public KSStruct(KeySequence ks, int dim) } } - internal class TypedObject + internal sealed class TypedObject { private sealed class DecimalStruct { @@ -386,7 +386,7 @@ public bool Equals(TypedObject other) } } - internal class KeySequence + internal sealed class KeySequence { private readonly TypedObject[] _ks; private readonly int _dim; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs index 5b3f63a96ee90..2e2baa402875a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs @@ -15,7 +15,7 @@ namespace System.Xml.Schema /// /// UPA violations will throw this exception /// - internal class UpaException : Exception + internal sealed class UpaException : Exception { private readonly object? _particle1; private readonly object? _particle2; @@ -36,7 +36,7 @@ public UpaException(object? particle1, object? particle2) /// SymbolsDictionary always recognizes all the symbols - the last one is a true wildcard - /// both name and namespace can be anything that none of the other symbols matched. /// - internal class SymbolsDictionary + internal sealed class SymbolsDictionary { private int _last; private readonly Hashtable _names; @@ -253,7 +253,7 @@ public Position(int symbol, object? particle) } } - internal class Positions + internal sealed class Positions { private readonly ArrayList _positions = new ArrayList(); @@ -362,10 +362,10 @@ public override void Dump(StringBuilder bb, SymbolsDictionary symbols, Positions /// /// Temporary node to represent NamespaceList. Will be expended as a choice of symbols /// - internal class NamespaceListNode : SyntaxTreeNode + internal sealed class NamespaceListNode : SyntaxTreeNode { - protected NamespaceList namespaceList; - protected object particle; + private NamespaceList namespaceList; + private object particle; public NamespaceListNode(NamespaceList namespaceList, object particle) { @@ -373,7 +373,7 @@ public NamespaceListNode(NamespaceList namespaceList, object particle) this.particle = particle; } - public virtual ICollection GetResolvedSymbols(SymbolsDictionary symbols) + public ICollection GetResolvedSymbols(SymbolsDictionary symbols) { return symbols.GetNamespaceListSymbols(namespaceList); } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DataTypeImplementation.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DataTypeImplementation.cs index aa017479a767c..e7523cb04ff51 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DataTypeImplementation.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DataTypeImplementation.cs @@ -22,7 +22,7 @@ public enum XmlSchemaDatatypeVariety Union } - internal class XsdSimpleValue + internal sealed class XsdSimpleValue { //Wrapper to store XmlType and TypedValue together private readonly XmlSchemaSimpleType _xmlType; private readonly object _typedValue; @@ -75,7 +75,7 @@ internal enum XmlSchemaWhiteSpace Collapse, } - internal class RestrictionFacets + internal sealed class RestrictionFacets { internal int Length; internal int MinLength; @@ -919,7 +919,7 @@ protected object GetValueToCheck(object value, IXmlNamespaceResolver nsmgr) { //List type - internal class Datatype_List : Datatype_anySimpleType + internal sealed class Datatype_List : Datatype_anySimpleType { private readonly DatatypeImplementation _itemType; private readonly int _minListSize; @@ -1178,7 +1178,7 @@ internal override RestrictionFlags ValidRestrictionFlags } //Union datatype - internal class Datatype_union : Datatype_anySimpleType + internal sealed class Datatype_union : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(object); private static readonly Type s_listValueType = typeof(object[]); @@ -1425,7 +1425,7 @@ internal override XmlValueConverter CreateValueConverter(XmlSchemaType schemaTyp public override XmlTypeCode TypeCode { get { return XmlTypeCode.AnyAtomicType; } } } - internal class Datatype_untypedAtomicType : Datatype_anyAtomicType + internal sealed class Datatype_untypedAtomicType : Datatype_anyAtomicType { internal override XmlValueConverter CreateValueConverter(XmlSchemaType schemaType) { @@ -1528,7 +1528,7 @@ internal override RestrictionFlags ValidRestrictionFlags */ - internal class Datatype_boolean : Datatype_anySimpleType + internal sealed class Datatype_boolean : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(bool); private static readonly Type s_listValueType = typeof(bool[]); @@ -1950,7 +1950,7 @@ internal override int Compare(object value1, object value2) } } - internal class Datatype_yearMonthDuration : Datatype_duration + internal sealed class Datatype_yearMonthDuration : Datatype_duration { internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) { @@ -1988,7 +1988,7 @@ internal class Datatype_yearMonthDuration : Datatype_duration public override XmlTypeCode TypeCode { get { return XmlTypeCode.YearMonthDuration; } } } - internal class Datatype_dayTimeDuration : Datatype_duration + internal sealed class Datatype_dayTimeDuration : Datatype_duration { internal override Exception? TryParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr, out object? typedValue) { @@ -2116,12 +2116,12 @@ internal override int Compare(object value1, object value2) } } - internal class Datatype_dateTimeNoTimeZone : Datatype_dateTimeBase + internal sealed class Datatype_dateTimeNoTimeZone : Datatype_dateTimeBase { internal Datatype_dateTimeNoTimeZone() : base(XsdDateTimeFlags.XdrDateTimeNoTz) { } } - internal class Datatype_dateTimeTimeZone : Datatype_dateTimeBase + internal sealed class Datatype_dateTimeTimeZone : Datatype_dateTimeBase { internal Datatype_dateTimeTimeZone() : base(XsdDateTimeFlags.XdrDateTime) { } } @@ -2152,17 +2152,17 @@ internal Datatype_dateTimeTimeZone() : base(XsdDateTimeFlags.XdrDateTime) { } */ - internal class Datatype_dateTime : Datatype_dateTimeBase + internal sealed class Datatype_dateTime : Datatype_dateTimeBase { internal Datatype_dateTime() : base(XsdDateTimeFlags.DateTime) { } } - internal class Datatype_timeNoTimeZone : Datatype_dateTimeBase + internal sealed class Datatype_timeNoTimeZone : Datatype_dateTimeBase { internal Datatype_timeNoTimeZone() : base(XsdDateTimeFlags.XdrTimeNoTz) { } } - internal class Datatype_timeTimeZone : Datatype_dateTimeBase + internal sealed class Datatype_timeTimeZone : Datatype_dateTimeBase { internal Datatype_timeTimeZone() : base(XsdDateTimeFlags.Time) { } } @@ -2193,7 +2193,7 @@ internal Datatype_timeTimeZone() : base(XsdDateTimeFlags.Time) { } */ - internal class Datatype_time : Datatype_dateTimeBase + internal sealed class Datatype_time : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Time; } } @@ -2226,7 +2226,7 @@ internal Datatype_time() : base(XsdDateTimeFlags.Time) { } */ - internal class Datatype_date : Datatype_dateTimeBase + internal sealed class Datatype_date : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Date; } } @@ -2259,7 +2259,7 @@ internal Datatype_date() : base(XsdDateTimeFlags.Date) { } */ - internal class Datatype_yearMonth : Datatype_dateTimeBase + internal sealed class Datatype_yearMonth : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.GYearMonth; } } @@ -2293,7 +2293,7 @@ internal Datatype_yearMonth() : base(XsdDateTimeFlags.GYearMonth) { } */ - internal class Datatype_year : Datatype_dateTimeBase + internal sealed class Datatype_year : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.GYear; } } @@ -2326,7 +2326,7 @@ internal Datatype_year() : base(XsdDateTimeFlags.GYear) { } */ - internal class Datatype_monthDay : Datatype_dateTimeBase + internal sealed class Datatype_monthDay : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.GMonthDay; } } @@ -2359,7 +2359,7 @@ internal Datatype_monthDay() : base(XsdDateTimeFlags.GMonthDay) { } */ - internal class Datatype_day : Datatype_dateTimeBase + internal sealed class Datatype_day : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.GDay; } } @@ -2393,7 +2393,7 @@ internal Datatype_day() : base(XsdDateTimeFlags.GDay) { } */ - internal class Datatype_month : Datatype_dateTimeBase + internal sealed class Datatype_month : Datatype_dateTimeBase { public override XmlTypeCode TypeCode { get { return XmlTypeCode.GMonth; } } @@ -2425,7 +2425,7 @@ internal Datatype_month() : base(XsdDateTimeFlags.GMonth) { } */ - internal class Datatype_hexBinary : Datatype_anySimpleType + internal sealed class Datatype_hexBinary : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(byte[]); private static readonly Type s_listValueType = typeof(byte[][]); @@ -2526,7 +2526,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_base64Binary : Datatype_anySimpleType + internal sealed class Datatype_base64Binary : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(byte[]); private static readonly Type s_listValueType = typeof(byte[][]); @@ -2626,7 +2626,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_anyURI : Datatype_anySimpleType + internal sealed class Datatype_anyURI : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(Uri); private static readonly Type s_listValueType = typeof(Uri[]); @@ -2724,7 +2724,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_QName : Datatype_anySimpleType + internal sealed class Datatype_QName : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); @@ -2858,7 +2858,7 @@ internal class Datatype_token : Datatype_normalizedString internal override XmlSchemaWhiteSpace BuiltInWhitespaceFacet { get { return XmlSchemaWhiteSpace.Collapse; } } } - internal class Datatype_tokenV1Compat : Datatype_normalizedStringV1Compat + internal sealed class Datatype_tokenV1Compat : Datatype_normalizedStringV1Compat { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Token; } } } @@ -2884,7 +2884,7 @@ and RFC 1766 */ - internal class Datatype_language : Datatype_token + internal sealed class Datatype_language : Datatype_token { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Language; } } } @@ -2990,7 +2990,7 @@ internal class Datatype_NCName : Datatype_Name */ - internal class Datatype_ID : Datatype_NCName + internal sealed class Datatype_ID : Datatype_NCName { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Id; } } @@ -3006,7 +3006,7 @@ internal class Datatype_ID : Datatype_NCName */ - internal class Datatype_IDREF : Datatype_NCName + internal sealed class Datatype_IDREF : Datatype_NCName { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Idref; } } @@ -3022,7 +3022,7 @@ internal class Datatype_IDREF : Datatype_NCName */ - internal class Datatype_ENTITY : Datatype_NCName + internal sealed class Datatype_ENTITY : Datatype_NCName { public override XmlTypeCode TypeCode { get { return XmlTypeCode.Entity; } } @@ -3060,7 +3060,7 @@ facet whose value is the name of a NOTATION declared in the */ - internal class Datatype_NOTATION : Datatype_anySimpleType + internal sealed class Datatype_NOTATION : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); @@ -3240,7 +3240,7 @@ internal override bool HasValueFacets */ - internal class Datatype_negativeInteger : Datatype_nonPositiveInteger + internal sealed class Datatype_negativeInteger : Datatype_nonPositiveInteger { private static readonly FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(decimal.MinValue, decimal.MinusOne); @@ -3443,7 +3443,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_byte : Datatype_short + internal sealed class Datatype_byte : Datatype_short { private static readonly Type s_atomicValueType = typeof(sbyte); private static readonly Type s_listValueType = typeof(sbyte[]); @@ -3698,7 +3698,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_unsignedByte : Datatype_unsignedShort + internal sealed class Datatype_unsignedByte : Datatype_unsignedShort { private static readonly Type s_atomicValueType = typeof(byte); private static readonly Type s_listValueType = typeof(byte[]); @@ -3753,7 +3753,7 @@ internal override int Compare(object value1, object value2) */ - internal class Datatype_positiveInteger : Datatype_nonNegativeInteger + internal sealed class Datatype_positiveInteger : Datatype_nonNegativeInteger { private static readonly FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(decimal.One, decimal.MaxValue); @@ -3765,7 +3765,7 @@ internal class Datatype_positiveInteger : Datatype_nonNegativeInteger /* XDR */ - internal class Datatype_doubleXdr : Datatype_double + internal sealed class Datatype_doubleXdr : Datatype_double { public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr) { @@ -3787,7 +3787,7 @@ public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespa } } - internal class Datatype_floatXdr : Datatype_float + internal sealed class Datatype_floatXdr : Datatype_float { public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr) { @@ -3809,7 +3809,7 @@ public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespa } } - internal class Datatype_QNameXdr : Datatype_anySimpleType + internal sealed class Datatype_QNameXdr : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(XmlQualifiedName); private static readonly Type s_listValueType = typeof(XmlQualifiedName[]); @@ -3846,12 +3846,12 @@ public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespa internal override Type ListValueType { get { return s_listValueType; } } } - internal class Datatype_ENUMERATION : Datatype_NMTOKEN + internal sealed class Datatype_ENUMERATION : Datatype_NMTOKEN { public override XmlTokenizedType TokenizedType { get { return XmlTokenizedType.ENUMERATION; } } } - internal class Datatype_char : Datatype_anySimpleType + internal sealed class Datatype_char : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(char); private static readonly Type s_listValueType = typeof(char[]); @@ -3903,7 +3903,7 @@ public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespa } } - internal class Datatype_fixed : Datatype_decimal + internal sealed class Datatype_fixed : Datatype_decimal { public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespaceResolver? nsmgr) { @@ -3953,7 +3953,7 @@ public override object ParseValue(string s, XmlNameTable? nameTable, IXmlNamespa } } - internal class Datatype_uuid : Datatype_anySimpleType + internal sealed class Datatype_uuid : Datatype_anySimpleType { private static readonly Type s_atomicValueType = typeof(Guid); private static readonly Type s_listValueType = typeof(Guid[]); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs index 25565bd6c6aab..7e784726a97b0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs @@ -13,7 +13,7 @@ namespace System.Xml { - internal partial class DtdParser : IDtdParser + internal sealed partial class DtdParser : IDtdParser { // // Private types diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs index 01d09c0ea70b2..65c5f9bc615d3 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs @@ -14,7 +14,7 @@ namespace System.Xml { - internal partial class DtdParser : IDtdParser + internal sealed partial class DtdParser : IDtdParser { // // IDtdParser interface diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/FacetChecker.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/FacetChecker.cs index 49a8beb01819a..02b452c945d73 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/FacetChecker.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/FacetChecker.cs @@ -993,7 +993,7 @@ internal static decimal Power(int x, int y) } - internal class Numeric10FacetsChecker : FacetsChecker + internal sealed class Numeric10FacetsChecker : FacetsChecker { private readonly decimal _maxValue; private readonly decimal _minValue; @@ -1127,7 +1127,7 @@ internal bool MatchEnumeration(decimal value, ArrayList enumeration, XmlValueCon } - internal class Numeric2FacetsChecker : FacetsChecker + internal sealed class Numeric2FacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1203,7 +1203,7 @@ private bool MatchEnumeration(double value, ArrayList enumeration, XmlValueConve } } - internal class DurationFacetsChecker : FacetsChecker + internal sealed class DurationFacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1274,7 +1274,7 @@ private bool MatchEnumeration(TimeSpan value, ArrayList enumeration) } } - internal class DateTimeFacetsChecker : FacetsChecker + internal sealed class DateTimeFacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1348,7 +1348,7 @@ private bool MatchEnumeration(DateTime value, ArrayList enumeration, XmlSchemaDa } } - internal class StringFacetsChecker : FacetsChecker + internal sealed class StringFacetsChecker : FacetsChecker { //All types derived from string & anyURI private static Regex? s_languagePattern; @@ -1505,7 +1505,7 @@ private bool MatchEnumeration(string value, ArrayList enumeration, XmlSchemaData } } - internal class QNameFacetsChecker : FacetsChecker + internal sealed class QNameFacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1573,11 +1573,11 @@ private bool MatchEnumeration(XmlQualifiedName value, ArrayList enumeration) } } - internal class MiscFacetsChecker : FacetsChecker + internal sealed class MiscFacetsChecker : FacetsChecker { //For bool, anySimpleType } - internal class BinaryFacetsChecker : FacetsChecker + internal sealed class BinaryFacetsChecker : FacetsChecker { //hexBinary & Base64Binary internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1642,7 +1642,7 @@ private bool MatchEnumeration(byte[] value, ArrayList enumeration, XmlSchemaData } } - internal class ListFacetsChecker : FacetsChecker + internal sealed class ListFacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { @@ -1703,7 +1703,7 @@ internal override bool MatchEnumeration(object value, ArrayList enumeration, Xml } } - internal class UnionFacetsChecker : FacetsChecker + internal sealed class UnionFacetsChecker : FacetsChecker { internal override Exception? CheckValueFacets(object value, XmlSchemaDatatype datatype) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/NamespaceList.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/NamespaceList.cs index 2114b9e40248e..6ed6ff98e6a91 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/NamespaceList.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/NamespaceList.cs @@ -385,7 +385,7 @@ private void RemoveNamespace(string tns) } }; - internal class NamespaceListV1Compat : NamespaceList + internal sealed class NamespaceListV1Compat : NamespaceList { public NamespaceListV1Compat(string namespaces, string targetNamespace) : base(namespaces, targetNamespace) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs index 550495e6aadea..9056db9b5323e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs @@ -19,7 +19,7 @@ internal enum Compositor Redefine }; - internal class RedefineEntry + internal sealed class RedefineEntry { internal XmlSchemaRedefine redefine; internal XmlSchema schemaToUpdate; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaInfo.cs index afd5c7840d4ed..2bf5e7d83c67e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaInfo.cs @@ -22,7 +22,7 @@ internal enum AttributeMatchState ValidateAttributeInvalidCall, } - internal class SchemaInfo : IDtdInfo + internal sealed class SchemaInfo : IDtdInfo { private readonly Dictionary _elementDecls = new Dictionary(); private readonly Dictionary _undeclaredElementDecls = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaNamespacemanager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaNamespacemanager.cs index 9c3b9055f3027..709182055367d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaNamespacemanager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaNamespacemanager.cs @@ -8,7 +8,7 @@ namespace System.Xml.Schema using System.Collections; using System.Collections.Generic; - internal class SchemaNamespaceManager : XmlNamespaceManager + internal sealed class SchemaNamespaceManager : XmlNamespaceManager { private readonly XmlSchemaObject _node; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaObjectTable.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaObjectTable.cs index 21abf9461d549..efb67b70d84cb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaObjectTable.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaObjectTable.cs @@ -154,7 +154,7 @@ public XmlSchemaObjectEntry(XmlQualifiedName name, XmlSchemaObject value) } } - internal class NamesCollection : ICollection + internal sealed class NamesCollection : ICollection { private readonly List _entries; private readonly int _size; @@ -209,7 +209,7 @@ public IEnumerator GetEnumerator() } //ICollection for Values - internal class ValuesCollection : ICollection + internal sealed class ValuesCollection : ICollection { private readonly List _entries; private readonly int _size; @@ -334,7 +334,7 @@ public void Reset() } } - internal class XSODictionaryEnumerator : XSOEnumerator, IDictionaryEnumerator + internal sealed class XSODictionaryEnumerator : XSOEnumerator, IDictionaryEnumerator { internal XSODictionaryEnumerator(List entries, int size, EnumeratorType enumType) : base(entries, size, enumType) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs index 645d77e41cc2a..fbd403feeb63f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSubstitutionGroup.cs @@ -25,7 +25,7 @@ internal XmlQualifiedName Examplar } } - internal class XmlSchemaSubstitutionGroupV1Compat : XmlSchemaSubstitutionGroup + internal sealed class XmlSchemaSubstitutionGroupV1Compat : XmlSchemaSubstitutionGroup { private readonly XmlSchemaChoice _choice = new XmlSchemaChoice(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs index b4b0488ea36f7..dc2ee89c99bb5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs @@ -44,7 +44,7 @@ internal enum ValidatorState SkipToEndElement, Finish, } - internal class IdRefNode + internal sealed class IdRefNode { internal string Id; internal int LineNo; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlUntypedStringConverter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlUntypedStringConverter.cs index e8855cff7431f..50f0d2d53390c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlUntypedStringConverter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlUntypedStringConverter.cs @@ -13,7 +13,7 @@ namespace System.Xml.Schema { // This is an atomic value converted for Silverlight XML core that knows only how to convert to and from string. // It does not recognize XmlAtomicValue or XPathItemType. - internal class XmlUntypedStringConverter + internal sealed class XmlUntypedStringConverter { // Fields private readonly bool _listsAllowed; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlValueConverter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlValueConverter.cs index 08c6d660d189e..ff507ae1ab293 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlValueConverter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlValueConverter.cs @@ -862,9 +862,9 @@ protected static DateTimeOffset UntypedAtomicToDateTimeOffset(string value) } } - internal class XmlNumeric10Converter : XmlBaseConverter + internal sealed class XmlNumeric10Converter : XmlBaseConverter { - protected XmlNumeric10Converter(XmlSchemaType schemaType) : base(schemaType) + private XmlNumeric10Converter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1128,9 +1128,9 @@ private object ChangeTypeWildcardSource(object value, Type destinationType, IXml #endregion } - internal class XmlNumeric2Converter : XmlBaseConverter + internal sealed class XmlNumeric2Converter : XmlBaseConverter { - protected XmlNumeric2Converter(XmlSchemaType schemaType) : base(schemaType) + private XmlNumeric2Converter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1299,9 +1299,9 @@ public override object ChangeType(object value, Type destinationType, IXmlNamesp #endregion } - internal class XmlDateTimeConverter : XmlBaseConverter + internal sealed class XmlDateTimeConverter : XmlBaseConverter { - protected XmlDateTimeConverter(XmlSchemaType schemaType) : base(schemaType) + private XmlDateTimeConverter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1531,9 +1531,9 @@ public override object ChangeType(object value, Type destinationType, IXmlNamesp #endregion } - internal class XmlBooleanConverter : XmlBaseConverter + internal sealed class XmlBooleanConverter : XmlBaseConverter { - protected XmlBooleanConverter(XmlSchemaType schemaType) : base(schemaType) + private XmlBooleanConverter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1686,9 +1686,9 @@ public override object ChangeType(object value, Type destinationType, IXmlNamesp #endregion } - internal class XmlMiscConverter : XmlBaseConverter + internal sealed class XmlMiscConverter : XmlBaseConverter { - protected XmlMiscConverter(XmlSchemaType schemaType) : base(schemaType) + private XmlMiscConverter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1915,9 +1915,9 @@ private object ChangeTypeWildcardSource(object value, Type destinationType, IXml #endregion } - internal class XmlStringConverter : XmlBaseConverter + internal sealed class XmlStringConverter : XmlBaseConverter { - protected XmlStringConverter(XmlSchemaType schemaType) : base(schemaType) + private XmlStringConverter(XmlSchemaType schemaType) : base(schemaType) { } @@ -1982,15 +1982,15 @@ public override object ChangeType(object value, Type destinationType, IXmlNamesp #endregion } - internal class XmlUntypedConverter : XmlListConverter + internal sealed class XmlUntypedConverter : XmlListConverter { private readonly bool _allowListToList; - protected XmlUntypedConverter() : base(DatatypeImplementation.UntypedAtomicType) + private XmlUntypedConverter() : base(DatatypeImplementation.UntypedAtomicType) { } - protected XmlUntypedConverter(XmlUntypedConverter atomicConverter, bool allowListToList) + private XmlUntypedConverter(XmlUntypedConverter atomicConverter, bool allowListToList) : base(atomicConverter, allowListToList ? StringArrayType : StringType) { _allowListToList = allowListToList; @@ -2508,9 +2508,9 @@ private bool SupportsType(Type clrType) } } - internal class XmlAnyConverter : XmlBaseConverter + internal sealed class XmlAnyConverter : XmlBaseConverter { - protected XmlAnyConverter(XmlTypeCode typeCode) : base(typeCode) + private XmlAnyConverter(XmlTypeCode typeCode) : base(typeCode) { } @@ -2839,9 +2839,9 @@ private XPathNavigator ToNavigator(XPathNavigator nav) } } - internal class XmlAnyListConverter : XmlListConverter + internal sealed class XmlAnyListConverter : XmlListConverter { - protected XmlAnyListConverter(XmlBaseConverter atomicConverter) : base(atomicConverter) + private XmlAnyListConverter(XmlBaseConverter atomicConverter) : base(atomicConverter) { } @@ -3113,12 +3113,12 @@ private string ListAsString(IEnumerable list, IXmlNamespaceResolver? nsResolver) } } - internal class XmlUnionConverter : XmlBaseConverter + internal sealed class XmlUnionConverter : XmlBaseConverter { private readonly XmlValueConverter[] _converters; private readonly bool _hasAtomicMember, _hasListMember; - protected XmlUnionConverter(XmlSchemaType schemaType) : base(schemaType) + private XmlUnionConverter(XmlSchemaType schemaType) : base(schemaType) { // Skip restrictions. It is safe to do that because this is a union, so it's not a built-in type while (schemaType.DerivedBy == XmlSchemaDerivationMethod.Restriction) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs index 41f3f51feb212..3ae4442c85323 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs @@ -21,7 +21,7 @@ namespace System.Xml.Serialization { - internal class CodeGenerator + internal sealed class CodeGenerator { internal const BindingFlags InstancePublicBindingFlags = BindingFlags.Instance | BindingFlags.Public; internal const BindingFlags InstanceBindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; @@ -1337,7 +1337,7 @@ internal void GotoMethodEnd() Br(_methodEndLabel); } - internal class WhileState + internal sealed class WhileState { public Label StartLabel; public Label CondLabel; @@ -1405,7 +1405,7 @@ internal void WhileEndCondition() } - internal class ArgBuilder + internal sealed class ArgBuilder { internal string Name; internal int Index; @@ -1418,7 +1418,7 @@ internal ArgBuilder(string name, int index, Type argType) } } - internal class ForState + internal sealed class ForState { private readonly LocalBuilder _indexVar; private readonly Label _beginLabel; @@ -1476,7 +1476,7 @@ internal enum Cmp : int GreaterThanOrEqualTo } - internal class IfState + internal sealed class IfState { private Label _elseBegin; private Label _endIf; @@ -1506,7 +1506,7 @@ internal Label ElseBegin } } - internal class LocalScope + internal sealed class LocalScope { public readonly LocalScope? parent; private readonly Dictionary _locals; @@ -1581,7 +1581,7 @@ public void AddToFreeLocals(Dictionary<(Type, string), Queue> free } } - internal class MethodBuilderInfo + internal sealed class MethodBuilderInfo { public readonly MethodBuilder MethodBuilder; public readonly Type[] ParameterTypes; @@ -1605,7 +1605,7 @@ public void Validate(Type? returnType, Type[] parameterTypes, MethodAttributes a } } - internal class CodeGeneratorConversionException : Exception + internal sealed class CodeGeneratorConversionException : Exception { private readonly Type _sourceType; private readonly Type _targetType; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifiers.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifiers.cs index ebbac5ed2e4e3..54f1e2c0aea32 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifiers.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/CodeIdentifiers.cs @@ -8,7 +8,7 @@ namespace System.Xml.Serialization using System.IO; using System.Globalization; - internal class CaseInsensitiveKeyComparer : CaseInsensitiveComparer, IEqualityComparer + internal sealed class CaseInsensitiveKeyComparer : CaseInsensitiveComparer, IEqualityComparer { public CaseInsensitiveKeyComparer() : base(CultureInfo.CurrentCulture) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs index f6be0bfb5afbc..1428e96571e24 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs @@ -14,7 +14,7 @@ namespace System.Xml.Serialization { - internal class TempAssembly + internal sealed class TempAssembly { internal const string GeneratedAssemblyNamespace = "Microsoft.Xml.Serialization.GeneratedAssembly"; private readonly Assembly? _assembly; @@ -23,7 +23,7 @@ internal class TempAssembly private IDictionary? _readerMethods; private TempMethodDictionary? _methods; - internal class TempMethod + internal sealed class TempMethod { internal MethodInfo? writeMethod; internal MethodInfo? readMethod; @@ -630,7 +630,7 @@ internal sealed class TempMethodDictionary : Dictionary } } - internal class TempAssemblyCacheKey + internal sealed class TempAssemblyCacheKey { private readonly string? _ns; private readonly object _type; @@ -655,7 +655,7 @@ public override int GetHashCode() } } - internal class TempAssemblyCache + internal sealed class TempAssemblyCache { private Dictionary _cache = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs index 890628ad68afc..d2a710419ddb9 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs @@ -10,7 +10,7 @@ namespace System.Xml.Serialization { - internal class Compiler + internal sealed class Compiler { private readonly StringWriter _writer = new StringWriter(CultureInfo.InvariantCulture); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ImportContext.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ImportContext.cs index cba6418f6827f..4b746fccb6ab8 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ImportContext.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ImportContext.cs @@ -79,7 +79,7 @@ public StringCollection Warnings } } - internal class SchemaObjectCache + internal sealed class SchemaObjectCache { private Hashtable? _graph; private Hashtable? _hash; @@ -252,7 +252,7 @@ private string ToString(XmlSchemaObject o, SchemaObjectWriter writer) } } - internal class SchemaGraph + internal sealed class SchemaGraph { private readonly ArrayList _empty = new ArrayList(); private readonly XmlSchemas _schemas; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs index 1a2c90c9457e7..3101817030689 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Mappings.cs @@ -139,7 +139,7 @@ internal string ToString(string? defaultNs) } } - internal class ElementAccessor : Accessor + internal sealed class ElementAccessor : Accessor { private bool _nullable; private bool _isSoap; @@ -180,7 +180,7 @@ internal ElementAccessor Clone() } } - internal class ChoiceIdentifierAccessor : Accessor + internal sealed class ChoiceIdentifierAccessor : Accessor { private string? _memberName; private string[]? _memberIds; @@ -205,15 +205,15 @@ internal MemberInfo? MemberInfo } } - internal class TextAccessor : Accessor + internal sealed class TextAccessor : Accessor { } - internal class XmlnsAccessor : Accessor + internal sealed class XmlnsAccessor : Accessor { } - internal class AttributeAccessor : Accessor + internal sealed class AttributeAccessor : Accessor { private bool _isSpecial; private bool _isList; @@ -359,7 +359,7 @@ internal override bool IsList } } - internal class NullableMapping : TypeMapping + internal sealed class NullableMapping : TypeMapping { private TypeMapping? _baseMapping; @@ -375,7 +375,7 @@ internal override string DefaultElementName } } - internal class ArrayMapping : TypeMapping + internal sealed class ArrayMapping : TypeMapping { private ElementAccessor[]? _elements; private ElementAccessor[]? _sortedElements; @@ -417,7 +417,7 @@ internal StructMapping? TopLevelMapping } } - internal class EnumMapping : PrimitiveMapping + internal sealed class EnumMapping : PrimitiveMapping { private ConstantMapping[]? _constants; private bool _isFlags; @@ -435,7 +435,7 @@ internal ConstantMapping[]? Constants } } - internal class ConstantMapping : Mapping + internal sealed class ConstantMapping : Mapping { private string? _xmlName; private string? _name; @@ -462,7 +462,7 @@ internal long Value } } - internal class StructMapping : TypeMapping, INameScope + internal sealed class StructMapping : TypeMapping, INameScope { private MemberMapping[]? _members; private StructMapping? _baseMapping; @@ -765,7 +765,7 @@ internal static void SortMostToLeastDerived(ElementAccessor[] elements) Array.Sort(elements, new AccessorComparer()); } - internal class AccessorComparer : IComparer + internal sealed class AccessorComparer : IComparer { public int Compare(object? o1, object? o2) { @@ -880,7 +880,7 @@ internal bool Match(AccessorMapping mapping) } } - internal class MemberMappingComparer : IComparer + internal sealed class MemberMappingComparer : IComparer { public int Compare(object? o1, object? o2) { @@ -911,7 +911,7 @@ public int Compare(object? o1, object? o2) } } - internal class MemberMapping : AccessorMapping + internal sealed class MemberMapping : AccessorMapping { private string? _name; private bool _checkShouldPersist; @@ -1004,7 +1004,7 @@ internal MemberMapping Clone() } } - internal class MembersMapping : TypeMapping + internal sealed class MembersMapping : TypeMapping { private MemberMapping[]? _members; private bool _hasWrapperElement = true; @@ -1054,7 +1054,7 @@ internal bool NamedAny } } - internal class SerializableMapping : SpecialMapping + internal sealed class SerializableMapping : SpecialMapping { private XmlSchema? _schema; private Type? _type; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Models.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Models.cs index 2e84e276bfc0b..4afb75ef820d1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Models.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Models.cs @@ -14,7 +14,7 @@ namespace System.Xml.Serialization // by looking for a particular set of custom attributes specific to the serialization format // and building an appropriate set of accessors/mappings. - internal class ModelScope + internal sealed class ModelScope { private readonly TypeScope _typeScope; private readonly Dictionary _models = new Dictionary(); @@ -116,7 +116,7 @@ internal TypeDesc TypeDesc } } - internal class ArrayModel : TypeModel + internal sealed class ArrayModel : TypeModel { internal ArrayModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } @@ -126,17 +126,17 @@ internal TypeModel Element } } - internal class PrimitiveModel : TypeModel + internal sealed class PrimitiveModel : TypeModel { internal PrimitiveModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } } - internal class SpecialModel : TypeModel + internal sealed class SpecialModel : TypeModel { internal SpecialModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } } - internal class StructModel : TypeModel + internal sealed class StructModel : TypeModel { internal StructModel(Type type, TypeDesc typeDesc, ModelScope scope) : base(type, typeDesc, scope) { } @@ -247,7 +247,7 @@ internal enum SpecifiedAccessor ReadWrite, } - internal class FieldModel + internal sealed class FieldModel { private readonly SpecifiedAccessor _checkSpecified = SpecifiedAccessor.None; private readonly MemberInfo? _memberInfo; @@ -369,7 +369,7 @@ internal bool IsProperty } } - internal class ConstantModel + internal sealed class ConstantModel { private readonly FieldInfo _fieldInfo; private readonly long _value; @@ -396,7 +396,7 @@ internal FieldInfo FieldInfo } } - internal class EnumModel : TypeModel + internal sealed class EnumModel : TypeModel { private ConstantModel[]? _constants; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/NameTable.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/NameTable.cs index 3ddda81e40268..c3ecf346d0926 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/NameTable.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/NameTable.cs @@ -10,7 +10,7 @@ namespace System.Xml.Serialization using System.Collections; using System.Collections.Generic; - internal class NameKey + internal sealed class NameKey { private readonly string? _ns; private readonly string? _name; @@ -37,7 +37,7 @@ internal interface INameScope { object? this[string? name, string? ns] { get; set; } } - internal class NameTable : INameScope + internal sealed class NameTable : INameScope { private readonly Dictionary _table = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/PrimitiveXmlSerializers.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/PrimitiveXmlSerializers.cs index 81fa7b25f0d10..018317a523cf2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/PrimitiveXmlSerializers.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/PrimitiveXmlSerializers.cs @@ -5,7 +5,7 @@ namespace System.Xml.Serialization { - internal class XmlSerializationPrimitiveWriter : System.Xml.Serialization.XmlSerializationWriter + internal sealed class XmlSerializationPrimitiveWriter : System.Xml.Serialization.XmlSerializationWriter { internal void Write_string(object? o) { @@ -229,7 +229,7 @@ protected override void InitCallbacks() } } - internal class XmlSerializationPrimitiveReader : System.Xml.Serialization.XmlSerializationReader + internal sealed class XmlSerializationPrimitiveReader : System.Xml.Serialization.XmlSerializationReader { internal object? Read_string() { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs index dfc4e0a3fc6f1..a1afa18babf09 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationReader.cs @@ -15,7 +15,7 @@ namespace System.Xml.Serialization { internal delegate void UnknownNodeAction(object? o); - internal class ReflectionXmlSerializationReader : XmlSerializationReader + internal sealed class ReflectionXmlSerializationReader : XmlSerializationReader { private static TypeDesc StringTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(string)); private static TypeDesc QnameTypeDesc { get; set; } = (new TypeScope()).GetTypeDesc(typeof(XmlQualifiedName)); @@ -2003,11 +2003,11 @@ private void CreateUnknownNodeException(object? o) CreateUnknownNodeException(); } - internal class CollectionMember : List + internal sealed class CollectionMember : List { } - internal class Member + internal sealed class Member { public MemberMapping Mapping; public CollectionMember? Collection; @@ -2026,7 +2026,7 @@ public Member(MemberMapping mapping) } } - internal class CheckTypeSource + internal sealed class CheckTypeSource { public string? Id { get; set; } public bool IsObject { get; set; } @@ -2034,7 +2034,7 @@ internal class CheckTypeSource public object? RefObject { get; set; } } - internal class ObjectHolder + internal sealed class ObjectHolder { public object? Object; } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs index 2e221bb7e173f..4614bd2c453ed 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs @@ -10,7 +10,7 @@ namespace System.Xml.Serialization { - internal class ReflectionXmlSerializationWriter : XmlSerializationWriter + internal sealed class ReflectionXmlSerializationWriter : XmlSerializationWriter { private readonly XmlMapping _mapping; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SchemaObjectWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SchemaObjectWriter.cs index e5ac5adefa025..49585a4ec4630 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SchemaObjectWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SchemaObjectWriter.cs @@ -13,7 +13,7 @@ namespace System.Xml.Serialization using System.Collections.Specialized; using System.Diagnostics.CodeAnalysis; - internal class XmlAttributeComparer : IComparer + internal sealed class XmlAttributeComparer : IComparer { public int Compare(object? o1, object? o2) { @@ -28,7 +28,7 @@ public int Compare(object? o1, object? o2) } } - internal class XmlFacetComparer : IComparer + internal sealed class XmlFacetComparer : IComparer { public int Compare(object? o1, object? o2) { @@ -38,7 +38,7 @@ public int Compare(object? o1, object? o2) } } - internal class QNameComparer : IComparer + internal sealed class QNameComparer : IComparer { public int Compare(object? o1, object? o2) { @@ -53,7 +53,7 @@ public int Compare(object? o1, object? o2) } } - internal class XmlSchemaObjectComparer : IComparer + internal sealed class XmlSchemaObjectComparer : IComparer { private readonly QNameComparer _comparer = new QNameComparer(); public int Compare(object? o1, object? o2) @@ -149,7 +149,7 @@ internal static XmlQualifiedName NameOf(XmlSchemaObjectCollection items) } } - internal class SchemaObjectWriter + internal sealed class SchemaObjectWriter { private readonly StringBuilder _w = new StringBuilder(); private int _indentLevel = -1; @@ -161,7 +161,7 @@ private void WriteIndent() _w.Append(' '); } } - protected void WriteAttribute(string localName, string ns, string? value) + private void WriteAttribute(string localName, string ns, string? value) { if (value == null || value.Length == 0) return; @@ -173,32 +173,32 @@ protected void WriteAttribute(string localName, string ns, string? value) _w.Append('='); _w.Append(value); } - protected void WriteAttribute(string localName, string ns, XmlQualifiedName value) + private void WriteAttribute(string localName, string ns, XmlQualifiedName value) { if (value.IsEmpty) return; WriteAttribute(localName, ns, value.ToString()); } - protected void WriteStartElement(string name) + private void WriteStartElement(string name) { NewLine(); _indentLevel++; _w.Append('['); _w.Append(name); } - protected void WriteEndElement() + private void WriteEndElement() { _w.Append(']'); _indentLevel--; } - protected void NewLine() + private void NewLine() { _w.Append(Environment.NewLine); WriteIndent(); } - protected string GetString() + private string GetString() { return _w.ToString(); } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs index eb99da1a1686d..ec3f4d5a9c7ea 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs @@ -12,7 +12,7 @@ namespace System.Xml.Serialization { - internal class SourceInfo + internal sealed class SourceInfo { //a[ia] //((global::System.Xml.Serialization.XmlSerializerNamespaces)p[0]) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Types.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Types.cs index b93ad75318aaa..83b660d0cccb2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Types.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/Types.cs @@ -62,7 +62,7 @@ internal enum TypeFlags Unsupported = 0x100000, } - internal class TypeDesc + internal sealed class TypeDesc { private readonly string _name; private readonly string _fullName; @@ -456,7 +456,7 @@ internal bool IsDerivedFrom(TypeDesc baseTypeDesc) } } - internal class TypeScope + internal sealed class TypeScope { private readonly Hashtable _typeDescs = new Hashtable(); private readonly Hashtable _arrayTypeDescs = new Hashtable(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlReflectionImporter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlReflectionImporter.cs index 702388f4581f4..dc29d7c74230f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlReflectionImporter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlReflectionImporter.cs @@ -2247,7 +2247,7 @@ internal static XmlTypeMapping GetTopLevelMapping(Type type, string? defaultName return mapping; } } - internal class ImportStructWorkItem + internal sealed class ImportStructWorkItem { private readonly StructModel _model; private readonly StructMapping _mapping; @@ -2262,7 +2262,7 @@ internal ImportStructWorkItem(StructModel model, StructMapping mapping) internal StructMapping Mapping { get { return _mapping; } } } - internal class WorkItems + internal sealed class WorkItems { private readonly ArrayList _list = new ArrayList(); @@ -2312,7 +2312,7 @@ internal void RemoveAt(int index) } } - internal class RecursionLimiter + internal sealed class RecursionLimiter { private readonly int _maxDepth; private int _depth; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs index 1176e56e0c70e..4eb4259c7daea 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSchemaImporter.cs @@ -1750,7 +1750,7 @@ private AttributeAccessor ImportSpecialAttribute(XmlQualifiedName name, string i return enumMapping; } - internal class ElementComparer : IComparer + internal sealed class ElementComparer : IComparer { public int Compare(object? o1, object? o2) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationEventSource.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationEventSource.cs index e7cf5a38466c0..03fcce6fc8477 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationEventSource.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationEventSource.cs @@ -8,7 +8,7 @@ namespace System.Xml.Serialization [EventSource( Name = "System.Xml.Serialzation.XmlSerialization", LocalizationResources = "FxResources.System.Private.Xml.SR")] - internal class XmlSerializationEventSource : EventSource + internal sealed class XmlSerializationEventSource : EventSource { internal static XmlSerializationEventSource Log = new XmlSerializationEventSource(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs index 4a427bce44295..008643d915631 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs @@ -2033,7 +2033,7 @@ public object CollectionItems /// public delegate object? XmlSerializationReadCallback(); - internal class XmlSerializationReaderCodeGen : XmlSerializationCodeGen + internal sealed class XmlSerializationReaderCodeGen : XmlSerializationCodeGen { private readonly Hashtable _idNames = new Hashtable(); private Hashtable? _enums; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs index 56fa9763c6ca3..e80a951c76d37 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs @@ -16,7 +16,7 @@ namespace System.Xml.Serialization using System.Xml.Schema; using System.Xml.Extensions; - internal class XmlSerializationReaderILGen : XmlSerializationILGen + internal sealed class XmlSerializationReaderILGen : XmlSerializationILGen { private readonly Dictionary _idNames = new Dictionary(); // Mapping name->id_XXXNN field diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs index cd532800f897f..0a975b1c5cb0b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs @@ -1424,7 +1424,7 @@ private string NextPrefix() return _aliasBase + _tempNamespacePrefix; } - internal class TypeEntry + internal sealed class TypeEntry { internal XmlSerializationWriteCallback? callback; internal string? typeNs; @@ -1532,7 +1532,7 @@ internal static void Add(Assembly a) } } - internal class ReflectionAwareCodeGen + internal sealed class ReflectionAwareCodeGen { private const string arrayMemberKey = "0"; // reflectionVariables holds mapping between a reflection entity @@ -2187,7 +2187,7 @@ public XSArrayInfo({4} propInfo){{ "; } - internal class XmlSerializationWriterCodeGen : XmlSerializationCodeGen + internal sealed class XmlSerializationWriterCodeGen : XmlSerializationCodeGen { internal XmlSerializationWriterCodeGen(IndentedWriter writer, TypeScope[] scopes, string access, string className) : base(writer, scopes, access, className) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs index 48c39db732c44..b8e125165ac20 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs @@ -15,7 +15,7 @@ namespace System.Xml.Serialization { - internal class XmlSerializationWriterILGen : XmlSerializationILGen + internal sealed class XmlSerializationWriterILGen : XmlSerializationILGen { internal XmlSerializationWriterILGen(TypeScope[] scopes, string access, string className) : base(scopes, access, className) @@ -2277,7 +2277,7 @@ private string FindChoiceEnumValue(ElementAccessor element, EnumMapping choiceMa } } - internal class ReflectionAwareILGen + internal sealed class ReflectionAwareILGen { // reflectionVariables holds mapping between a reflection entity // referenced in the generated code (such as TypeInfo, diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/indentedWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/indentedWriter.cs index 365707c2619c0..a1dbe3ea07de7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/indentedWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/indentedWriter.cs @@ -8,7 +8,7 @@ namespace System.Xml.Serialization /// /// This class will write to a stream and manage indentation. /// - internal class IndentedWriter + internal sealed class IndentedWriter { private readonly TextWriter _writer; private bool _needIndent; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/DescendantQuery.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/DescendantQuery.cs index 3f2ee1b3fa78b..70913a34b88e8 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/DescendantQuery.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/DescendantQuery.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class DescendantQuery : DescendantBaseQuery + internal sealed class DescendantQuery : DescendantBaseQuery { private XPathNodeIterator? _nodeIterator; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Filter.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Filter.cs index 11ecec19c49c7..228833a49cb31 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Filter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Filter.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class Filter : AstNode + internal sealed class Filter : AstNode { private readonly AstNode _input; private readonly AstNode _condition; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Function.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Function.cs index 4b8157850ea2e..579ee685be867 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Function.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Function.cs @@ -6,7 +6,7 @@ namespace MS.Internal.Xml.XPath { - internal class Function : AstNode + internal sealed class Function : AstNode { public enum FunctionType { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Group.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Group.cs index de0171981253f..b19cc55695aff 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Group.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Group.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class Group : AstNode + internal sealed class Group : AstNode { private readonly AstNode _groupNode; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/IteratorFilter.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/IteratorFilter.cs index 9123f14e32796..e1572e34ae1ca 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/IteratorFilter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/IteratorFilter.cs @@ -6,7 +6,7 @@ namespace MS.Internal.Xml.XPath { - internal class IteratorFilter : XPathNodeIterator + internal sealed class IteratorFilter : XPathNodeIterator { private readonly XPathNodeIterator _innerIterator; private readonly string _name; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operand.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operand.cs index ae309945f4158..f3bfbdaff6f4a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operand.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operand.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class Operand : AstNode + internal sealed class Operand : AstNode { private readonly XPathResultType _type; private readonly object _val; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operator.cs index 6dd69c8e611ca..f6ed8c1fec969 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Operator.cs @@ -6,7 +6,7 @@ namespace MS.Internal.Xml.XPath { - internal class Operator : AstNode + internal sealed class Operator : AstNode { public enum Op { // order is aligned with XPathOperator diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/PreSiblingQuery.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/PreSiblingQuery.cs index 6db2488019be5..311dc6895a923 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/PreSiblingQuery.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/PreSiblingQuery.cs @@ -20,10 +20,10 @@ namespace MS.Internal.Xml.XPath // --- if false, we hold with row #I and apply this algorithm starting for row #I+1 // --- when we done with #I+1 we continue with row #I - internal class PreSiblingQuery : CacheAxisQuery + internal sealed class PreSiblingQuery : CacheAxisQuery { public PreSiblingQuery(Query qyInput, string name, string prefix, XPathNodeType typeTest) : base(qyInput, name, prefix, typeTest) { } - protected PreSiblingQuery(PreSiblingQuery other) : base(other) { } + private PreSiblingQuery(PreSiblingQuery other) : base(other) { } private static bool NotVisited(XPathNavigator nav, List parentStk) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Root.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Root.cs index 505bc9e2bb3a4..44e1ad17fdf68 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Root.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Root.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class Root : AstNode + internal sealed class Root : AstNode { public Root() { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Variable.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Variable.cs index 45eb4bcf71548..0ea67b9483978 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Variable.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/Variable.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class Variable : AstNode + internal sealed class Variable : AstNode { private readonly string _localname; private readonly string _prefix; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathAncestorIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathAncestorIterator.cs index d5b07d571e986..d27040a15b678 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathAncestorIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathAncestorIterator.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class XPathAncestorIterator : XPathAxisIterator + internal sealed class XPathAncestorIterator : XPathAxisIterator { public XPathAncestorIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) { } public XPathAncestorIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathChildIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathChildIterator.cs index 1db05129cec2f..8c2c5bcca23da 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathChildIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathChildIterator.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class XPathChildIterator : XPathAxisIterator + internal sealed class XPathChildIterator : XPathAxisIterator { public XPathChildIterator(XPathNavigator nav, XPathNodeType type) : base(nav, type, /*matchSelf:*/false) { } public XPathChildIterator(XPathNavigator nav, string name, string namespaceURI) : base(nav, name, namespaceURI, /*matchSelf:*/false) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathDescendantIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathDescendantIterator.cs index 65a0e9b17972b..aa1bfe0277634 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathDescendantIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathDescendantIterator.cs @@ -5,7 +5,7 @@ namespace MS.Internal.Xml.XPath { - internal class XPathDescendantIterator : XPathAxisIterator + internal sealed class XPathDescendantIterator : XPathAxisIterator { private int _level; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathMultyIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathMultyIterator.cs index 69c80c3d7da96..e35ec3f253fa9 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathMultyIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathMultyIterator.cs @@ -10,11 +10,11 @@ namespace MS.Internal.Xml.XPath using System.Globalization; using System.Collections; - internal class XPathMultyIterator : ResetableIterator + internal sealed class XPathMultyIterator : ResetableIterator { - protected ResetableIterator[] arr; - protected int firstNotEmpty; - protected int position; + private ResetableIterator[] arr; + private int firstNotEmpty; + private int position; public XPathMultyIterator(ArrayList inputArray) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathParser.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathParser.cs index bafaa79a82b9a..9f1c1f1a6ea8b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathParser.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathParser.cs @@ -9,7 +9,7 @@ namespace MS.Internal.Xml.XPath { - internal class XPathParser + internal sealed class XPathParser { private readonly XPathScanner _scanner; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSelectionIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSelectionIterator.cs index e710cf3556fef..ab2d689a977e5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSelectionIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSelectionIterator.cs @@ -8,7 +8,7 @@ namespace MS.Internal.Xml.XPath // We need this wrapper object to: // 1. Calculate position // 2. Protect internal query.Current from user who may call MoveNext(). - internal class XPathSelectionIterator : ResetableIterator + internal sealed class XPathSelectionIterator : ResetableIterator { private XPathNavigator _nav; private readonly Query _query; @@ -20,7 +20,7 @@ internal XPathSelectionIterator(XPathNavigator nav, Query query) _query = query; } - protected XPathSelectionIterator(XPathSelectionIterator it) + private XPathSelectionIterator(XPathSelectionIterator it) { _nav = it._nav.Clone(); _query = (Query)it._query.Clone(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSingletonIterator.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSingletonIterator.cs index 67cdd88036038..9c62162089b4a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSingletonIterator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathSingletonIterator.cs @@ -6,7 +6,7 @@ namespace MS.Internal.Xml.XPath { - internal class XPathSingletonIterator : ResetableIterator + internal sealed class XPathSingletonIterator : ResetableIterator { private readonly XPathNavigator _nav; private int _position; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorKeyComparer.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorKeyComparer.cs index 2e4a259a8d415..703aca1d6e1e2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorKeyComparer.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorKeyComparer.cs @@ -6,7 +6,7 @@ namespace System.Xml.XPath { - internal class XPathNavigatorKeyComparer : IEqualityComparer + internal sealed class XPathNavigatorKeyComparer : IEqualityComparer { bool IEqualityComparer.Equals(object? obj1, object? obj2) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs index 94c1dce35728a..2b9a0eb0a81e9 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs @@ -1081,7 +1081,7 @@ private void SetEOF() } #if NAVREADER_SUPPORTSLINEINFO - internal class XPathNavigatorReaderWithLI : XPathNavigatorReader, System.Xml.IXmlLineInfo { + internal sealed class XPathNavigatorReaderWithLI : XPathNavigatorReader, System.Xml.IXmlLineInfo { internal XPathNavigatorReaderWithLI( XPathNavigator navToRead, IXmlLineInfo xli, IXmlSchemaInfo? xsi ) : base( navToRead, xli, xsi ) { } @@ -1095,7 +1095,7 @@ internal XPathNavigatorReaderWithLI( XPathNavigator navToRead, IXmlLineInfo xli, public virtual int LinePosition { get { return IsReading ? this.lineInfo.LinePosition : 0; } } } - internal class XPathNavigatorReaderWithLIAndSI : XPathNavigatorReaderWithLI, System.Xml.IXmlLineInfo, System.Xml.Schema.IXmlSchemaInfo { + internal sealed class XPathNavigatorReaderWithLIAndSI : XPathNavigatorReaderWithLI, System.Xml.IXmlLineInfo, System.Xml.Schema.IXmlSchemaInfo { internal XPathNavigatorReaderWithLIAndSI( XPathNavigator navToRead, IXmlLineInfo xli, IXmlSchemaInfo xsi ) : base( navToRead, xli, xsi ) { } @@ -1114,7 +1114,7 @@ internal XPathNavigatorReaderWithLIAndSI( XPathNavigator navToRead, IXmlLineInfo } #endif - internal class XPathNavigatorReaderWithSI : XPathNavigatorReader, System.Xml.Schema.IXmlSchemaInfo + internal sealed class XPathNavigatorReaderWithSI : XPathNavigatorReader, System.Xml.Schema.IXmlSchemaInfo { internal XPathNavigatorReaderWithSI(XPathNavigator navToRead, IXmlLineInfo? xli, IXmlSchemaInfo xsi) : base(navToRead, xli, xsi) @@ -1126,13 +1126,13 @@ internal XPathNavigatorReaderWithSI(XPathNavigator navToRead, IXmlLineInfo? xli, // IXmlSchemaInfo //----------------------------------------------- - public virtual XmlSchemaValidity Validity { get { return IsReading ? this.schemaInfo!.Validity : XmlSchemaValidity.NotKnown; } } + public XmlSchemaValidity Validity { get { return IsReading ? this.schemaInfo!.Validity : XmlSchemaValidity.NotKnown; } } public override bool IsDefault { get { return IsReading ? this.schemaInfo!.IsDefault : false; } } - public virtual bool IsNil { get { return IsReading ? this.schemaInfo!.IsNil : false; } } - public virtual XmlSchemaSimpleType? MemberType { get { return IsReading ? this.schemaInfo!.MemberType : null; } } - public virtual XmlSchemaType? SchemaType { get { return IsReading ? this.schemaInfo!.SchemaType : null; } } - public virtual XmlSchemaElement? SchemaElement { get { return IsReading ? this.schemaInfo!.SchemaElement : null; } } - public virtual XmlSchemaAttribute? SchemaAttribute { get { return IsReading ? this.schemaInfo!.SchemaAttribute : null; } } + public bool IsNil { get { return IsReading ? this.schemaInfo!.IsNil : false; } } + public XmlSchemaSimpleType? MemberType { get { return IsReading ? this.schemaInfo!.MemberType : null; } } + public XmlSchemaType? SchemaType { get { return IsReading ? this.schemaInfo!.SchemaType : null; } } + public XmlSchemaElement? SchemaElement { get { return IsReading ? this.schemaInfo!.SchemaElement : null; } } + public XmlSchemaAttribute? SchemaAttribute { get { return IsReading ? this.schemaInfo!.SchemaAttribute : null; } } } /// @@ -1140,7 +1140,7 @@ internal XPathNavigatorReaderWithSI(XPathNavigator navToRead, IXmlLineInfo? xli, /// Only one XmlEmptyNavigator exists per AppDomain (Singleton). That's why the constructor is private. /// Use the Singleton property to get the EmptyNavigator. /// - internal class XmlEmptyNavigator : XPathNavigator + internal sealed class XmlEmptyNavigator : XPathNavigator { private static volatile XmlEmptyNavigator? s_singleton; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManager.cs index 2e35677cf389a..9ceef6da61f9c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManager.cs @@ -7,7 +7,7 @@ namespace System.Xml { - internal partial class XmlDownloadManager + internal sealed partial class XmlDownloadManager { internal Stream GetStream(Uri uri, ICredentials? credentials, IWebProxy? proxy) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManagerAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManagerAsync.cs index 35886f6aad519..1e5efb99d35d7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManagerAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlDownloadManagerAsync.cs @@ -9,7 +9,7 @@ namespace System.Xml { - internal partial class XmlDownloadManager + internal sealed partial class XmlDownloadManager { internal Task GetStreamAsync(Uri uri, ICredentials? credentials, IWebProxy? proxy) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlEncoding.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlEncoding.cs index 5a2c74afa0e76..57742531e80aa 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlEncoding.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlEncoding.cs @@ -7,7 +7,7 @@ namespace System.Xml { - internal class UTF16Decoder : System.Text.Decoder + internal sealed class UTF16Decoder : System.Text.Decoder { private readonly bool _bigEndian; private int _lastByte; @@ -161,7 +161,7 @@ public override void Convert(byte[] bytes, int byteIndex, int byteCount, char[] } } - internal class SafeAsciiDecoder : Decoder + internal sealed class SafeAsciiDecoder : Decoder { public SafeAsciiDecoder() { @@ -544,7 +544,7 @@ internal void Ucs4ToUTF16(uint code, char[] chars, int charIndex) } } - internal class Ucs4Decoder4321 : Ucs4Decoder + internal sealed class Ucs4Decoder4321 : Ucs4Decoder { internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { @@ -585,7 +585,7 @@ internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, c } } - internal class Ucs4Decoder1234 : Ucs4Decoder + internal sealed class Ucs4Decoder1234 : Ucs4Decoder { internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { @@ -627,7 +627,7 @@ internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, c } - internal class Ucs4Decoder2143 : Ucs4Decoder + internal sealed class Ucs4Decoder2143 : Ucs4Decoder { internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { @@ -669,7 +669,7 @@ internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, c } - internal class Ucs4Decoder3412 : Ucs4Decoder + internal sealed class Ucs4Decoder3412 : Ucs4Decoder { internal override int GetFullChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlNullResolver.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlNullResolver.cs index ea93f83dfffbb..cae8ad8549695 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlNullResolver.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlNullResolver.cs @@ -5,7 +5,7 @@ namespace System.Xml { - internal class XmlNullResolver : XmlResolver + internal sealed class XmlNullResolver : XmlResolver { public static readonly XmlNullResolver Singleton = new XmlNullResolver(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs index 65ca16a8928ad..a3fb2822f6d10 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs @@ -24,7 +24,7 @@ namespace System.Xml.Xsl.IlGen /// /// List of all XmlIL runtime constructors. /// - internal class XmlILStorageMethods + internal sealed class XmlILStorageMethods { // Aggregates public readonly MethodInfo? AggAvg; @@ -467,7 +467,7 @@ internal enum GenerateNameType /// /// Contains helper methods used during the code generation phase. /// - internal class GenerateHelper + internal sealed class GenerateHelper { private MethodBase? _methInfo; private ILGenerator? _ilgen; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/IteratorDescriptor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/IteratorDescriptor.cs index 46bb78a63e092..cc7b1fcc8394c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/IteratorDescriptor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/IteratorDescriptor.cs @@ -227,7 +227,7 @@ public Type ItemStorageType /// /// A data class to hold information for a "Current" StorageLocation. /// - internal class CurrentContext + internal sealed class CurrentContext { public CurrentContext(LocalBuilder local, MethodInfo currentMethod) { @@ -243,7 +243,7 @@ public CurrentContext(LocalBuilder local, MethodInfo currentMethod) /// Iterators are joined together, are nested within each other, and reference each other. This internal class /// contains detailed information about iteration next labels, caching, iterator item location, etc. /// - internal class IteratorDescriptor + internal sealed class IteratorDescriptor { private GenerateHelper _helper; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/OptimizerPatterns.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/OptimizerPatterns.cs index 4c3965fac095f..dc3bd0d9a387c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/OptimizerPatterns.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/OptimizerPatterns.cs @@ -52,7 +52,7 @@ internal enum OptimizerPatternArgument /// As the Qil graph is traversed, patterns are identified. Subtrees that match these patterns are /// annotated with this class, which identifies the matching patterns and their arguments. /// - internal class OptimizerPatterns : IQilAnnotation + internal sealed class OptimizerPatterns : IQilAnnotation { private static readonly int s_patternCount = Enum.GetValues(typeof(OptimizerPatternName)).Length; @@ -260,7 +260,7 @@ public bool MatchesPattern(OptimizerPatternName pattern) /// /// Return name of this annotation. /// - public virtual string Name + public string Name { get { return "Patterns"; } } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/StaticDataManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/StaticDataManager.cs index 8a163206ea3a4..12931f66a90f1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/StaticDataManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/StaticDataManager.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.IlGen /// This internal class maintains a list of unique values. Each unique value is assigned a unique ID, which can /// be used to quickly access the value, since it corresponds to the value's position in the list. /// - internal class UniqueList where T : notnull + internal sealed class UniqueList where T : notnull { private readonly Dictionary _lookup = new Dictionary(); private readonly List _list = new List(); @@ -59,7 +59,7 @@ public T[] ToArray() /// 3. All Xml types that will be used at run-time /// 4. All global variables and parameters /// - internal class StaticDataManager + internal sealed class StaticDataManager { private UniqueList? _uniqueNames; private UniqueList? _uniqueFilters; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILAnnotation.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILAnnotation.cs index e1580e23a70f9..59183e0606309 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILAnnotation.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILAnnotation.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.IlGen /// /// Several annotations are created and attached to Qil nodes during the optimization and code generation phase. /// - internal class XmlILAnnotation : ListBase + internal sealed class XmlILAnnotation : ListBase { private readonly object? _annPrev; private MethodInfo? _funcMethod; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs index 730054b9eb521..8e37d3eefc078 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILConstructAnalyzer.cs @@ -47,7 +47,7 @@ internal enum XmlILConstructMethod /// /// Every node is annotated with information about how it will be constructed by ILGen. /// - internal class XmlILConstructInfo : IQilAnnotation + internal sealed class XmlILConstructInfo : IQilAnnotation { private readonly QilNodeType _nodeType; private PossibleXmlStates _xstatesInitial, _xstatesFinal, _xstatesBeginLoop, _xstatesEndLoop; @@ -373,7 +373,7 @@ public ArrayList CallersInfo /// /// Return name of this annotation. /// - public virtual string Name + public string Name { get { return "ConstructInfo"; } } @@ -789,7 +789,7 @@ private bool MaybeContent(XmlQueryType typ) /// Scans the content of an ElementCtor and tries to minimize the number of well-formed checks that will have /// to be made at runtime when constructing content. /// - internal class XmlILElementAnalyzer : XmlILStateAnalyzer + internal sealed class XmlILElementAnalyzer : XmlILStateAnalyzer { private readonly NameTable _attrNames = new NameTable(); private readonly ArrayList _dupAttrs = new ArrayList(); @@ -942,7 +942,7 @@ private void CheckAttributeNamespaceConstruct(XmlQueryType typ) /// Scans constructed content, looking for redundant namespace declarations. If any are found, then they are marked /// and removed later. /// - internal class XmlILNamespaceAnalyzer + internal sealed class XmlILNamespaceAnalyzer { private readonly XmlNamespaceManager _nsmgr = new XmlNamespaceManager(new NameTable()); private bool _addInScopeNmsp; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILModule.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILModule.cs index 9d193487a007d..006865b50b4c0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILModule.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILModule.cs @@ -20,7 +20,7 @@ internal enum XmlILMethodAttributes Raw = 2, // Raw method which should not add an implicit first argument of type XmlQueryRuntime } - internal class XmlILModule + internal sealed class XmlILModule { private static long s_assemblyId; // Unique identifier used to ensure that assembly names are unique within AppDomain private static readonly ModuleBuilder s_LREModule = CreateLREModule(); // Module used to emit dynamic lightweight-reflection-emit (LRE) methods diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs index 42146fa167060..1c7ea589ad30f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlILOptimizerVisitor.cs @@ -11,7 +11,7 @@ namespace System.Xml.Xsl.IlGen { - internal class XmlILOptimizerVisitor : QilPatternVisitor + internal sealed class XmlILOptimizerVisitor : QilPatternVisitor { private static readonly QilPatterns s_patternsNoOpt = CreatePatternsNoOpt(); @@ -152,7 +152,7 @@ protected override QilNode VisitReference(QilNode oldNode) /// /// Strongly-typed AllowReplace. /// - protected bool AllowReplace(XmlILOptimization pattern, QilNode original) + private bool AllowReplace(XmlILOptimization pattern, QilNode original) { return base.AllowReplace((int)pattern, original); } @@ -160,7 +160,7 @@ protected bool AllowReplace(XmlILOptimization pattern, QilNode original) /// /// Strongly-typed Replace. /// - protected QilNode Replace(XmlILOptimization pattern, QilNode original, QilNode replacement) + private QilNode Replace(XmlILOptimization pattern, QilNode original, QilNode replacement) { return base.Replace((int)pattern, original, replacement); } @@ -5128,7 +5128,7 @@ private bool DependsOn(QilNode expr, QilNode target) /// /// Returns true if there is no PositionOf operator within the "expr" subtree that references iterator "iter". /// - protected bool NonPositional(QilNode expr, QilNode iter) + private bool NonPositional(QilNode expr, QilNode iter) { return !(new PositionOfFinder().Find(expr, iter)); } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs index 49e6f3df25e30..7c5a4c78db480 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/XmlIlVisitor.cs @@ -27,7 +27,7 @@ namespace System.Xml.Xsl.IlGen /// the stack or a local variable by an iterator. The iterator is passive, and will just wait for /// a caller to pull the data and/or instruct the iterator to enumerate the next value. /// - internal class XmlILVisitor : QilVisitor + internal sealed class XmlILVisitor : QilVisitor { private QilExpression _qil = null!; private GenerateHelper _helper = null!; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilChoice.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilChoice.cs index daff0690f6d2b..d7fc6a4dd1ecf 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilChoice.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilChoice.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilChoice : QilBinary + internal sealed class QilChoice : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilDataSource.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilDataSource.cs index 99ad88b9a45a2..006f770405342 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilDataSource.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilDataSource.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilDataSource : QilBinary + internal sealed class QilDataSource : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilExpression.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilExpression.cs index 5b743985b8b0e..2c0261566199a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilExpression.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilExpression.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.Qil /// designed for optimization, composition with virtual XML views, translation into other forms, /// and direct execution. See also the QIL specification.

/// - internal class QilExpression : QilNode + internal sealed class QilExpression : QilNode { private QilFactory _factory; private QilNode _isDebug; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilFunction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilFunction.cs index b6dd25a1c8da8..38f119df85d57 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilFunction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilFunction.cs @@ -20,7 +20,7 @@ namespace System.Xml.Xsl.Qil /// override the types after setting the function's definition (for example, an XQuery /// might define a function's return type to be wider than its definition would imply.) /// - internal class QilFunction : QilReference + internal sealed class QilFunction : QilReference { private QilNode _arguments, _definition, _sideEffects; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvoke.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvoke.cs index 0530d062e2c9a..e4daf017b2585 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvoke.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvoke.cs @@ -11,7 +11,7 @@ namespace System.Xml.Xsl.Qil /// /// A function invocation node which represents a call to a Qil functions. /// - internal class QilInvoke : QilBinary + internal sealed class QilInvoke : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs index dcc36df218df2..e72f2d41b639e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeEarlyBound.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.Qil /// /// A function invocation node which represents a call to an early bound Clr function. /// - internal class QilInvokeEarlyBound : QilTernary + internal sealed class QilInvokeEarlyBound : QilTernary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeLateBound.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeLateBound.cs index dfa095333190e..0947ec7fcf28b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeLateBound.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilInvokeLateBound.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.Qil /// /// A function invocation node which represents a call to an late bound function. /// - internal class QilInvokeLateBound : QilBinary + internal sealed class QilInvokeLateBound : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs index d105ee90bf45d..d22519c964ed1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilList.cs @@ -13,7 +13,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilList : QilNode + internal sealed class QilList : QilNode { private int _count; private QilNode[] _members; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilLoop.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilLoop.cs index b3f2f29898563..6fad4d5c14c38 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilLoop.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilLoop.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilLoop : QilBinary + internal sealed class QilLoop : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilName.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilName.cs index f39da3bacf554..f7810e1a524c5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilName.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilName.cs @@ -13,7 +13,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilName : QilLiteral + internal sealed class QilName : QilLiteral { private string _local; private string _uri; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilParameter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilParameter.cs index 258dcb1067545..b8b78e3fdcb2c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilParameter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilParameter.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.Qil /// /// View over a Qil parameter node. /// - internal class QilParameter : QilIterator + internal sealed class QilParameter : QilIterator { private QilNode? _name; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilSortKey.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilSortKey.cs index 073e8a291fd67..98c64f5ec784d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilSortKey.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilSortKey.cs @@ -12,7 +12,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilSortKey : QilBinary + internal sealed class QilSortKey : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilStrConcat.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilStrConcat.cs index 8dafd52113c44..40ab77c95c29d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilStrConcat.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilStrConcat.cs @@ -12,7 +12,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilStrConcat : QilBinary + internal sealed class QilStrConcat : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTargetType.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTargetType.cs index adcc09db04b7d..2d0931291f624 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTargetType.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTargetType.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilTargetType : QilBinary + internal sealed class QilTargetType : QilBinary { //----------------------------------------------- // Constructor diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTypeChecker.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTypeChecker.cs index 2b187a375aa06..592c9a3f1173b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTypeChecker.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilTypeChecker.cs @@ -18,7 +18,7 @@ namespace System.Xml.Xsl.Qil /// 1. Infer XmlQueryType of Qil nodes (constant, from arguments, etc) /// 2. Validate the arguments of Qil nodes if DEBUG is defined /// - internal class QilTypeChecker + internal sealed class QilTypeChecker { public QilTypeChecker() { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilUnary.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilUnary.cs index 112cf60971487..6d0cabff115b0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilUnary.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilUnary.cs @@ -13,7 +13,7 @@ namespace System.Xml.Xsl.Qil /// /// Don't construct QIL nodes directly; instead, use the QilFactory. /// - internal class QilUnary : QilNode + internal sealed class QilUnary : QilNode { private QilNode _child; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs index ed9fd36a44862..3a4d4805b44eb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilValidationVisitor.cs @@ -6,7 +6,7 @@ namespace System.Xml.Xsl.Qil { - /// A internal class that validates QilExpression graphs. + /// An internal class that validates QilExpression graphs. /// /// QilValidationVisitor traverses the QilExpression graph once to enforce the following constraints: /// @@ -24,7 +24,7 @@ namespace System.Xml.Xsl.Qil /// to print correctly.)

///
/// - internal class QilValidationVisitor : QilScopedVisitor + internal sealed class QilValidationVisitor : QilScopedVisitor { #if DEBUG private readonly QilTypeChecker _typeCheck = new QilTypeChecker(); @@ -41,12 +41,12 @@ public static void Validate(QilNode node) new QilValidationVisitor().VisitAssumeReference(node); } - protected QilValidationVisitor() { } + private QilValidationVisitor() { } #if DEBUG - protected Hashtable allNodes = new ObjectHashtable(); - protected Hashtable parents = new ObjectHashtable(); - protected Hashtable scope = new ObjectHashtable(); + private Hashtable allNodes = new ObjectHashtable(); + private Hashtable parents = new ObjectHashtable(); + private Hashtable scope = new ObjectHashtable(); //----------------------------------------------- diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilVisitor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilVisitor.cs index 561d83704219a..3e5998b65885c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilVisitor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilVisitor.cs @@ -433,7 +433,7 @@ protected virtual QilNode VisitReference(QilNode n) } //for checking the depth of QilNode to avoid StackOverflow in visit stage - internal class QilDepthChecker + internal sealed class QilDepthChecker { private const int MAX_QIL_DEPTH = 800; private readonly Dictionary _visitedRef = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilXmlWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilXmlWriter.cs index 2a0505962bcd9..b81a2a61f4beb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilXmlWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QIL/QilXmlWriter.cs @@ -35,10 +35,10 @@ internal interface IQilAnnotation /// Annotations are serialized as processing-instructions in front of a node. /// Feel free to subclass this visitor to customize its behavior. /// - internal class QilXmlWriter : QilScopedVisitor + internal sealed class QilXmlWriter : QilScopedVisitor { - protected XmlWriter writer; - protected Options options; + private XmlWriter writer; + private Options options; private readonly NameGenerator _ngen; [Flags] @@ -90,7 +90,7 @@ public void ToXml(QilNode node) /// 3. IList{object} -- recursively call WriteAnnotations for each object in list /// 4. otherwise, do not write the annotation /// - protected virtual void WriteAnnotations(object? ann) + private void WriteAnnotations(object? ann) { string? s = null, name = null; @@ -121,7 +121,7 @@ protected virtual void WriteAnnotations(object? ann) /// /// Called in order to write out source line information. /// - protected virtual void WriteLineInfo(QilNode node) + private void WriteLineInfo(QilNode node) { this.writer.WriteAttributeString("lineInfo", string.Format(CultureInfo.InvariantCulture, "[{0},{1} -- {2},{3}]", node.SourceLine!.Start.Line, node.SourceLine.Start.Pos, @@ -132,7 +132,7 @@ protected virtual void WriteLineInfo(QilNode node) /// /// Called in order to write out the xml type of a node. /// - protected virtual void WriteXmlType(QilNode node) + private void WriteXmlType(QilNode node) { this.writer.WriteAttributeString("xmlType", node.XmlType!.ToString((this.options & Options.RoundTripTypeInfo) != 0 ? "S" : "G")); } @@ -316,7 +316,7 @@ protected override void AfterVisit(QilNode node) /// /// Find list of all iterators and functions which are referenced before they have been declared. /// - internal class ForwardRefFinder : QilVisitor + internal sealed class ForwardRefFinder : QilVisitor { private readonly List _fwdrefs = new List(); private readonly List _backrefs = new List(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QueryReaderSettings.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QueryReaderSettings.cs index 9bd4a85ac9023..4a056cc8af08d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QueryReaderSettings.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/QueryReaderSettings.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl { - internal class QueryReaderSettings + internal sealed class QueryReaderSettings { private readonly bool _validatingReader; private readonly XmlReaderSettings? _xmlReaderSettings; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DecimalFormatter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DecimalFormatter.cs index ee3d21356c627..dba6c4bf8d555 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DecimalFormatter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DecimalFormatter.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.Runtime { - internal class DecimalFormat + internal sealed class DecimalFormat { public NumberFormatInfo info; public char digit; @@ -24,7 +24,7 @@ internal DecimalFormat(NumberFormatInfo info, char digit, char zeroDigit, char p } } - internal class DecimalFormatter + internal sealed class DecimalFormatter { private readonly NumberFormatInfo _posFormatInfo; private readonly NumberFormatInfo _negFormatInfo; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs index f595922ebcb62..4641526f0b5e1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/DocumentOrderComparer.cs @@ -16,7 +16,7 @@ namespace System.Xml.Xsl.Runtime /// XmlNodeOrder.Unknown, a stable order between documents is maintained by an ordered list mapping each root node /// to an ordering index. /// - internal class DocumentOrderComparer : IComparer + internal sealed class DocumentOrderComparer : IComparer { private List _roots; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs index c66fce5d16be9..5197ab728ecf8 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleLookup.cs @@ -16,7 +16,7 @@ namespace System.Xml.Xsl.Runtime /// This class keeps a list of whitespace rules in order to determine whether whitespace children of particular /// elements should be stripped. /// - internal class WhitespaceRuleLookup + internal sealed class WhitespaceRuleLookup { private readonly Hashtable _qnames; private readonly ArrayList _wildcards; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs index dabcd574c4775..7deb72ba577ab 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/WhitespaceRuleReader.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.Runtime { /// /// - internal class WhitespaceRuleReader : XmlWrappingReader + internal sealed class WhitespaceRuleReader : XmlWrappingReader { private readonly WhitespaceRuleLookup _wsRules; private readonly BitStack _stkStrip; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs index 6340197f07011..ef7ddb38c9962 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs @@ -17,7 +17,7 @@ namespace System.Xml.Xsl.Runtime /// Table of bound extension functions. Once an extension function is bound and entered into the table, future bindings /// will be very fast. This table is not thread-safe. /// - internal class XmlExtensionFunctionTable + internal sealed class XmlExtensionFunctionTable { private readonly Dictionary _table; private XmlExtensionFunction _funcCached; @@ -53,7 +53,7 @@ public XmlExtensionFunction Bind(string name, string namespaceUri, int numArgs, /// /// This internal class contains methods that allow binding to extension functions and invoking them. /// - internal class XmlExtensionFunction + internal sealed class XmlExtensionFunction { private string _namespaceUri; // Extension object identifier private string _name; // Name of this method diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs index ee3756d2e7afe..78a849b50020c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlNavigatorFilter.cs @@ -58,7 +58,7 @@ public abstract class XmlNavigatorFilter /// /// Filters any non-element and any element with a non-matching local name or namespace uri. /// - internal class XmlNavNameFilter : XmlNavigatorFilter + internal sealed class XmlNavNameFilter : XmlNavigatorFilter { private readonly string _localName; private readonly string _namespaceUri; @@ -133,7 +133,7 @@ public override bool IsFiltered(XPathNavigator navigator) /// /// Filters any node not of the specified type (type may not be attribute or namespace). /// - internal class XmlNavTypeFilter : XmlNavigatorFilter + internal sealed class XmlNavTypeFilter : XmlNavigatorFilter { private static readonly XmlNavigatorFilter[] s_typeFilters = CreateTypeFilters(); private readonly XPathNodeType _nodeType; @@ -224,7 +224,7 @@ public override bool IsFiltered(XPathNavigator navigator) /// /// Filters all attribute nodes. /// - internal class XmlNavAttrFilter : XmlNavigatorFilter + internal sealed class XmlNavAttrFilter : XmlNavigatorFilter { private static readonly XmlNavigatorFilter s_singleton = new XmlNavAttrFilter(); @@ -296,7 +296,7 @@ public override bool IsFiltered(XPathNavigator navigator) /// /// Never filter nodes. /// - internal class XmlNavNeverFilter : XmlNavigatorFilter + internal sealed class XmlNavNeverFilter : XmlNavigatorFilter { private static readonly XmlNavigatorFilter s_singleton = new XmlNavNeverFilter(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs index c2d3b2e3781d1..752a94d36ec10 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryContext.cs @@ -335,7 +335,7 @@ public void OnXsltMessageEncountered(string message) /// /// Simple implementation of XsltMessageEncounteredEventArgs. /// - internal class XmlILQueryEventArgs : XsltMessageEncounteredEventArgs + internal sealed class XmlILQueryEventArgs : XsltMessageEncounteredEventArgs { private readonly string _message; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs index 53387597f2db4..fa076608d7548 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.Runtime /// /// Contains all static data that is used by the runtime. /// - internal class XmlQueryStaticData + internal sealed class XmlQueryStaticData { // Name of the field to serialize to public const string DataFieldName = "staticData"; @@ -402,7 +402,7 @@ public EarlyBoundInfo[] EarlyBound /// /// Subclass of BinaryReader used to serialize query static data. /// - internal class XmlQueryDataReader : BinaryReader + internal sealed class XmlQueryDataReader : BinaryReader { public XmlQueryDataReader(Stream input) : base(input) { } @@ -432,7 +432,7 @@ public sbyte ReadSByte(sbyte minValue, sbyte maxValue) /// /// Subclass of BinaryWriter used to deserialize query static data. /// - internal class XmlQueryDataWriter : BinaryWriter + internal sealed class XmlQueryDataWriter : BinaryWriter { public XmlQueryDataWriter(Stream output) : base(output) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs index 873f52b8b6eec..677c8660cc2a3 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSequenceWriter.cs @@ -54,7 +54,7 @@ internal abstract class XmlSequenceWriter /// /// An implementation of XmlSequenceWriter that builds a cached XPath/XQuery sequence. /// - internal class XmlCachedSequenceWriter : XmlSequenceWriter + internal sealed class XmlCachedSequenceWriter : XmlSequenceWriter { private readonly XmlQueryItemSequence _seqTyped; private XPathDocument _doc; @@ -119,7 +119,7 @@ public override void WriteItem(XPathItem item) /// 3. A call to XmlRawWriter.WriteWhitespace(" ") is made between adjacent atomic values at the top-level /// 4. All items in the top-level sequence are merged together into a single result document. /// - internal class XmlMergeSequenceWriter : XmlSequenceWriter + internal sealed class XmlMergeSequenceWriter : XmlSequenceWriter { private readonly XmlRawWriter _xwrt; private bool _lastItemWasAtomic; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKey.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKey.cs index fe94d265fb885..6d5c89d14ca8b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKey.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlSortKey.cs @@ -98,7 +98,7 @@ protected int CompareToEmpty(object obj) /// Sort key for the empty sequence. Empty sequence always compares sorts either before all other values, /// or after all other values. /// - internal class XmlEmptySortKey : XmlSortKey + internal sealed class XmlEmptySortKey : XmlSortKey { private readonly bool _isEmptyGreatest; @@ -136,7 +136,7 @@ public override int CompareTo(object obj) /// /// Sort key for xs:decimal values. /// - internal class XmlDecimalSortKey : XmlSortKey + internal sealed class XmlDecimalSortKey : XmlSortKey { private readonly decimal _decVal; @@ -194,7 +194,7 @@ public override int CompareTo(object obj) /// /// Sort key for xs:int values. /// - internal class XmlIntSortKey : XmlSortKey + internal sealed class XmlIntSortKey : XmlSortKey { private readonly int _intVal; @@ -221,7 +221,7 @@ public override int CompareTo(object obj) /// /// Sort key for xs:string values. Strings are sorted according to a byte-wise sort key calculated by caller. /// - internal class XmlStringSortKey : XmlSortKey + internal sealed class XmlStringSortKey : XmlSortKey { private readonly SortKey _sortKey; private readonly byte[] _sortKeyBytes; @@ -294,7 +294,7 @@ public override int CompareTo(object obj) /// /// Sort key for Double values. /// - internal class XmlDoubleSortKey : XmlSortKey + internal sealed class XmlDoubleSortKey : XmlSortKey { private readonly double _dblVal; private readonly bool _isNaN; @@ -361,7 +361,7 @@ public override int CompareTo(object obj) /// /// Sort key for DateTime values (just convert DateTime to ticks and use Long sort key). /// - internal class XmlDateTimeSortKey : XmlIntegerSortKey + internal sealed class XmlDateTimeSortKey : XmlIntegerSortKey { public XmlDateTimeSortKey(DateTime value, XmlCollation collation) : base(value.Ticks, collation) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XslNumber.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XslNumber.cs index 4673961e6b7b2..a0f4551447647 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XslNumber.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XslNumber.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.Runtime { - internal class TokenInfo + internal sealed class TokenInfo { public char startChar; // First element of numbering sequence for format token public int startIdx; // Start index of separator token @@ -109,7 +109,7 @@ public static TokenInfo CreateFormat(string formatString, int startIdx, int tokL } } - internal class NumberFormatter : NumberFormatterBase + internal sealed class NumberFormatter : NumberFormatterBase { private readonly string _formatString; private readonly int _lang; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/SourceLineInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/SourceLineInfo.cs index d0b14c713385a..ac4e94d9bc5f7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/SourceLineInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/SourceLineInfo.cs @@ -25,11 +25,11 @@ public bool LessOrEqual(Location that) } [DebuggerDisplay("{Uri} [{StartLine},{StartPos} -- {EndLine},{EndPos}]")] - internal class SourceLineInfo : ISourceLineInfo + internal sealed class SourceLineInfo : ISourceLineInfo { - protected string? uriString; - protected Location start; - protected Location end; + private string? uriString; + private Location start; + private Location end; public SourceLineInfo(string? uriString, int startLine, int startPos, int endLine, int endPos) : this(uriString, new Location(startLine, startPos), new Location(endLine, endPos)) @@ -53,7 +53,7 @@ public SourceLineInfo(string? uriString, Location start, Location end) /// When VS debugger steps into IL marked with 0xfeefee, it will continue the step until it reaches /// some user code. /// - protected const int NoSourceMagicNumber = 0xfeefee; + private const int NoSourceMagicNumber = 0xfeefee; public static SourceLineInfo NoSource = new SourceLineInfo(string.Empty, NoSourceMagicNumber, 0, NoSourceMagicNumber, 0); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathBuilder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathBuilder.cs index 0be02ffcb2f7b..80a5b06014e8a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathBuilder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathBuilder.cs @@ -828,7 +828,7 @@ public static bool IsFunctionAvailable(string localName, string nsUri) return FunctionTable.ContainsKey(localName); } - internal class FixupVisitor : QilReplaceVisitor + internal sealed class FixupVisitor : QilReplaceVisitor { private new readonly QilPatternFactory f; private readonly QilNode _fixupCurrent, _fixupPosition, _fixupLast; // fixup nodes we are replacing @@ -975,7 +975,7 @@ bool GetStopVisitMark(QilNode n) { #endif } - internal class FunctionInfo + internal sealed class FunctionInfo { public T id; public int minArgs; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathCompileException.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathCompileException.cs index 6b2e67550a4c1..c4d4e030964ba 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathCompileException.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathCompileException.cs @@ -7,7 +7,7 @@ namespace System.Xml.Xsl.XPath { [Serializable] - internal class XPathCompileException : XslLoadException + internal sealed class XPathCompileException : XslLoadException { public string? queryString; public int startChar; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathContext.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathContext.cs index f5d9b05608a04..94002f11864bc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathContext.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathContext.cs @@ -13,7 +13,7 @@ namespace System.Xml.Xsl.XPath { - internal class XPathContext { + internal sealed class XPathContext { // Context is the most fundamental concept of XPath // In docs it is -- "current node-set" and "current node in this node-set" // on practice in this implementation we have "current node" (C), "position of current node in current node-set" (P) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathParser.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathParser.cs index 2c1a51cf9469e..f2226a57863dd 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathParser.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathParser.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XPath { using XPathNodeType = System.Xml.XPath.XPathNodeType; - internal class XPathParser + internal sealed class XPathParser { private XPathScanner? _scanner; private IXPathBuilder? _builder; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlILCommand.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlILCommand.cs index 0cb44e83eee64..0ee028ba24909 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlILCommand.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlILCommand.cs @@ -16,7 +16,7 @@ namespace System.Xml.Xsl /// /// This is the executable command generated by the XmlILGenerator. /// - internal class XmlILCommand + internal sealed class XmlILCommand { private readonly ExecuteDelegate _delExec; private readonly XmlQueryStaticData _staticData; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlIlGenerator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlIlGenerator.cs index 0e4272fb3d899..19dbf13cf50a1 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlIlGenerator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlIlGenerator.cs @@ -49,7 +49,7 @@ namespace System.Xml.Xsl /// As visits to each node in the tree start and end, various Analyzers are invoked. These Analyzers incrementally /// collect and store information that is later used to generate faster and smaller code. /// - internal class XmlILGenerator + internal sealed class XmlILGenerator { private QilExpression? _qil; private GenerateHelper? _helper; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQualifiedNameTest.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQualifiedNameTest.cs index b140fc567eac5..a3af660f0379e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQualifiedNameTest.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XmlQualifiedNameTest.cs @@ -21,7 +21,7 @@ namespace System.Xml.Xsl /// ~{A}:* XmlQualifiedNameTest.New("B", "A") Match QName with namespace not A and any local name /// {~A}:B only as a result of the intersection Match QName with namespace not A and local name B /// - internal class XmlQualifiedNameTest : XmlQualifiedName + internal sealed class XmlQualifiedNameTest : XmlQualifiedName { private readonly bool _exclude; private const string wildcard = "*"; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs index 81f8c17061a1d..c8ad0097517fb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs @@ -22,7 +22,7 @@ internal enum XslVersion // One more reason to for this design is to normolize apply-templates and apply-imports to one concept: // apply-templates is apply-imports(compiler.Root). // For now I don't create new files for these new classes to simplify integrations WebData <-> WebData_xsl - internal class RootLevel : StylesheetLevel + internal sealed class RootLevel : StylesheetLevel { public RootLevel(Stylesheet principal) { @@ -30,7 +30,7 @@ public RootLevel(Stylesheet principal) } } - internal class Compiler + internal sealed class Compiler { public XsltSettings Settings; public bool IsDebug; @@ -400,7 +400,7 @@ public int Compare(CompilerError? x, CompilerError? y) } } - internal class Output + internal sealed class Output { public XmlWriterSettings Settings; public string? Version; @@ -430,7 +430,7 @@ public Output() } } - internal class DecimalFormats : KeyedCollection + internal sealed class DecimalFormats : KeyedCollection { protected override XmlQualifiedName GetKeyForItem(DecimalFormatDecl format) { @@ -438,7 +438,7 @@ protected override XmlQualifiedName GetKeyForItem(DecimalFormatDecl format) } } - internal class DecimalFormatDecl + internal sealed class DecimalFormatDecl { public readonly XmlQualifiedName Name; public readonly string InfinitySymbol; @@ -457,7 +457,7 @@ public DecimalFormatDecl(XmlQualifiedName name, string infinitySymbol, string na } } - internal class NsAlias + internal sealed class NsAlias { public readonly string ResultNsUri; public readonly string? ResultPrefix; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerError.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerError.cs index fa10fd9a2480f..1ae326c41bc12 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerError.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/CompilerError.cs @@ -5,7 +5,7 @@ namespace System.Xml.Xsl.Xslt { - internal class CompilerError + internal sealed class CompilerError { public CompilerError(string fileName, int line, int column, string errorNumber, string errorText) { @@ -29,7 +29,7 @@ public CompilerError(string fileName, int line, int column, string errorNumber, public string FileName { get; set; } } - internal class CompilerErrorCollection : CollectionBase + internal sealed class CompilerErrorCollection : CollectionBase { public CompilerErrorCollection() { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/InvokeGenerator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/InvokeGenerator.cs index 6e15fc5605a9d..9cd4c14dc1334 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/InvokeGenerator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/InvokeGenerator.cs @@ -20,7 +20,7 @@ ArrayList actualArgs -- Array of QilNodes annotated with names. When name of fo is used as invokeArg, otherwise formalArg's default value is cloned and used. **/ - internal class InvokeGenerator : QilCloneVisitor + internal sealed class InvokeGenerator : QilCloneVisitor { private readonly bool _debug; private readonly Stack _iterStack; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs index b7a110a2e6023..5b35ae0a37f77 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/KeyMatchBuilder.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.Xslt { - internal class KeyMatchBuilder : XPathBuilder, XPathPatternParser.IPatternBuilder + internal sealed class KeyMatchBuilder : XPathBuilder, XPathPatternParser.IPatternBuilder { private int _depth; private readonly PathConvertor _convertor; @@ -55,14 +55,14 @@ public override void StartBuild() // -------------------------------------- GetPredicateBuilder() --------------------------------------- - public virtual IXPathBuilder GetPredicateBuilder(QilNode ctx) + public IXPathBuilder GetPredicateBuilder(QilNode ctx) { return this; } // This code depends on particula shapes that XPathBuilder generates. // It works only on pathes. - internal class PathConvertor : QilReplaceVisitor + internal sealed class PathConvertor : QilReplaceVisitor { private new readonly XPathQilFactory f; private QilNode? _fixup; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Keywords.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Keywords.cs index 7574183e0ca17..89626c7e10070 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Keywords.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Keywords.cs @@ -5,7 +5,7 @@ namespace System.Xml.Xsl.Xslt { - internal class KeywordsTable + internal sealed class KeywordsTable { public XmlNameTable NameTable; public string AnalyzeString; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/MatcherBuilder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/MatcherBuilder.cs index 3e16e60d002d8..0df9d3b3a9d7a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/MatcherBuilder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/MatcherBuilder.cs @@ -86,7 +86,7 @@ namespace System.Xml.Xsl.Xslt */ #endregion - internal class TemplateMatch + internal sealed class TemplateMatch { public static readonly TemplateMatchComparer Comparer = new TemplateMatchComparer(); @@ -224,7 +224,7 @@ private void NipOffTypeNameCheck() } } - internal class TemplateMatchComparer : IComparer + internal sealed class TemplateMatchComparer : IComparer { // TemplateMatch x is "greater" than TemplateMatch y iff // * x's priority is greater than y's priority, or @@ -258,7 +258,7 @@ public Pattern(TemplateMatch match, int priority) } } - internal class PatternBag + internal sealed class PatternBag { public Dictionary> FixedNamePatterns = new Dictionary>(); public List FixedNamePatternsNames = new List(); // Needed only to guarantee a stable order @@ -292,7 +292,7 @@ public void Add(Pattern pattern) } } - internal class MatcherBuilder + internal sealed class MatcherBuilder { private readonly XPathQilFactory _f; private readonly ReferenceReplacer _refReplacer; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs index ffcbe6d8e387c..3a2fa196302cc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/OutputScopeManager.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.Xslt { - internal class OutputScopeManager + internal sealed class OutputScopeManager { public struct ScopeReord { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs index 3731f85020b81..a97cc5eccd862 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGenerator.cs @@ -23,7 +23,7 @@ namespace System.Xml.Xsl.Xslt // Everywhere in this code in case of error in the stylesheet we should call ReportError or ReportWarning - internal class ReferenceReplacer : QilReplaceVisitor + internal sealed class ReferenceReplacer : QilReplaceVisitor { private QilReference? _lookFor, _replaceBy; @@ -45,7 +45,7 @@ protected override QilNode VisitReference(QilNode n) } } - internal partial class QilGenerator : IErrorHelper + internal sealed partial class QilGenerator : IErrorHelper { private readonly CompilerScopeManager _scope; private readonly OutputScopeManager _outputScope; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs index 38d543b513841..7918c2995e69c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilGeneratorEnv.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.Xslt using FunctionInfo = XPathBuilder.FunctionInfo; using T = XmlQueryTypeFactory; - internal partial class QilGenerator : IXPathEnvironment + internal sealed partial class QilGenerator : IXPathEnvironment { // Everywhere in this code in case of error in the stylesheet we should throw XslLoadException. // This helper IErrorHelper implementation is used to wrap XmlException's into XslLoadException's. diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilStrConcatenator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilStrConcatenator.cs index 32c71b7e35221..96010a3a622c7 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilStrConcatenator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/QilStrConcatenator.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.Xslt { - internal class QilStrConcatenator + internal sealed class QilStrConcatenator { private readonly XPathQilFactory _f; private readonly StringBuilder _builder; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs index d486470c823df..0f74a98c23dad 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs @@ -11,7 +11,7 @@ namespace System.Xml.Xsl.Xslt { - internal class Scripts + internal sealed class Scripts { private readonly Compiler _compiler; private readonly TrimSafeDictionary _nsToType = new TrimSafeDictionary(); @@ -44,7 +44,7 @@ public TrimSafeDictionary ScriptClasses return null; } - internal class TrimSafeDictionary + internal sealed class TrimSafeDictionary { private readonly Dictionary _backingDictionary = new Dictionary(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Stylesheet.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Stylesheet.cs index 011862c1ff00a..c25973488f32a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Stylesheet.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/Stylesheet.cs @@ -23,7 +23,7 @@ internal class StylesheetLevel public Dictionary> ApplyFunctions = new Dictionary>(); } - internal class Stylesheet : StylesheetLevel + internal sealed class Stylesheet : StylesheetLevel { private readonly Compiler _compiler; public List ImportHrefs = new List(); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs index b6c659080ad8e..e60c3ce827c8c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternBuilder.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.Xslt { using T = XmlQueryTypeFactory; - internal class XPathPatternBuilder : XPathPatternParser.IPatternBuilder + internal sealed class XPathPatternBuilder : XPathPatternParser.IPatternBuilder { private readonly XPathPredicateEnvironment _predicateEnvironment; private readonly XPathBuilder _predicateBuilder; @@ -40,7 +40,7 @@ public QilNode FixupNode get { return _fixupNode; } } - public virtual void StartBuild() + public void StartBuild() { Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); _inTheBuild = true; @@ -63,7 +63,7 @@ private void FixupFilterBinding(QilLoop filter, QilNode newBinding) } [return: NotNullIfNotNull("result")] - public virtual QilNode? EndBuild(QilNode? result) + public QilNode? EndBuild(QilNode? result) { Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); if (result == null) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternParser.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternParser.cs index 2f9c06bafc1e0..2cae17eacbdc5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternParser.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XPathPatternParser.cs @@ -12,7 +12,7 @@ namespace System.Xml.Xsl.Xslt using XPathParser = XPathParser; using XPathNodeType = System.Xml.XPath.XPathNodeType; - internal class XPathPatternParser + internal sealed class XPathPatternParser { public interface IPatternBuilder : IXPathBuilder { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAst.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAst.cs index 6c6b0912c552a..9c94a48a2cd77 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAst.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAst.cs @@ -58,7 +58,7 @@ internal enum XslNodeType WithParam, } - internal class NsDecl + internal sealed class NsDecl { public readonly NsDecl? Prev; public readonly string? Prefix; // Empty string denotes the default namespace, null - extension or excluded namespace @@ -198,7 +198,7 @@ internal enum CycleCheck Completed = 2, } - internal class AttributeSet : ProtoTemplate + internal sealed class AttributeSet : ProtoTemplate { public CycleCheck CycleCheck; // Used to detect circular references @@ -225,7 +225,7 @@ public void MergeContent(AttributeSet other) } } - internal class Template : ProtoTemplate + internal sealed class Template : ProtoTemplate { public readonly string? Match; public readonly QilName Mode; @@ -274,7 +274,7 @@ public override string GetDebugName() } } - internal class VarPar : XslNode + internal sealed class VarPar : XslNode { public XslFlags DefValueFlags; public QilNode? Value; // Contains value for WithParams and global VarPars @@ -282,7 +282,7 @@ internal class VarPar : XslNode public VarPar(XslNodeType nt, QilName name, string? select, XslVersion xslVer) : base(nt, name, select, xslVer) { } } - internal class Sort : XslNode + internal sealed class Sort : XslNode { public readonly string? Lang; public readonly string? DataType; @@ -299,7 +299,7 @@ public Sort(string select, string? lang, string? dataType, string? order, string } } - internal class Keys : KeyedCollection> + internal sealed class Keys : KeyedCollection> { protected override QilName GetKeyForItem(List list) { @@ -308,7 +308,7 @@ protected override QilName GetKeyForItem(List list) } } - internal class Key : XslNode + internal sealed class Key : XslNode { public readonly string? Match; public readonly string? Use; @@ -354,7 +354,7 @@ internal enum NumberLevel Any, } - internal class Number : XslNode + internal sealed class Number : XslNode { public readonly NumberLevel Level; public readonly string? Count; @@ -382,7 +382,7 @@ public Number(NumberLevel level, string? count, string? from, string? value, } } - internal class NodeCtor : XslNode + internal sealed class NodeCtor : XslNode { public readonly string NameAvt; public readonly string? NsAvt; @@ -395,7 +395,7 @@ public NodeCtor(XslNodeType nt, string nameAvt, string? nsAvt, XslVersion xslVer } } - internal class Text : XslNode + internal sealed class Text : XslNode { public readonly SerializationHints Hints; @@ -406,7 +406,7 @@ public Text(string data, SerializationHints hints, XslVersion xslVer) } } - internal class XslNodeEx : XslNode + internal sealed class XslNodeEx : XslNode { public readonly ISourceLineInfo? ElemNameLi; public readonly ISourceLineInfo? EndTagLi; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs index 2f0ffada81514..963f3411cea70 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XslAstAnalyzer.cs @@ -18,7 +18,7 @@ namespace System.Xml.Xsl.Xslt // ------------------------------- XslAstAnalyzer ------------------------------- - internal class XslAstAnalyzer : XslVisitor + internal sealed class XslAstAnalyzer : XslVisitor { private CompilerScopeManager? _scope; private Compiler? _compiler; @@ -52,7 +52,7 @@ internal class XslAstAnalyzer : XslVisitor /// Represents a graph using hashtable of adjacency lists. /// /// Vertex type - internal class Graph : Dictionary?> + internal sealed class Graph : Dictionary?> where V : XslNode { private static readonly IList s_empty = (new List()).AsReadOnly(); @@ -851,7 +851,7 @@ public void ReportError(string res, params string?[]? args) { } public void ReportWarning(string res, params string?[]? args) { } } - internal class XPathAnalyzer : IXPathBuilder + internal sealed class XPathAnalyzer : IXPathBuilder { private readonly XPathParser _xpathParser = new XPathParser(); private readonly CompilerScopeManager _scope; @@ -969,22 +969,22 @@ public XslFlags AnalyzeAvt(string? source) } } - public virtual void StartBuild() + public void StartBuild() { } - public virtual XslFlags EndBuild(XslFlags result) + public XslFlags EndBuild(XslFlags result) { return result; } - public virtual XslFlags String(string value) + public XslFlags String(string value) { _typeDonor = null; return XslFlags.String; } - public virtual XslFlags Number(double value) + public XslFlags Number(double value) { _typeDonor = null; return XslFlags.Number; @@ -1009,7 +1009,7 @@ public virtual XslFlags Number(double value) /*Union */ XslFlags.Nodeset, }; - public virtual XslFlags Operator(XPathOperator op, XslFlags left, XslFlags right) + public XslFlags Operator(XPathOperator op, XslFlags left, XslFlags right) { _typeDonor = null; Debug.Assert(op != XPathOperator.Unknown); @@ -1017,7 +1017,7 @@ public virtual XslFlags Operator(XPathOperator op, XslFlags left, XslFlags right return result | s_operatorType[(int)op]; } - public virtual XslFlags Axis(XPathAxis xpathAxis, XPathNodeType nodeType, string? prefix, string? name) + public XslFlags Axis(XPathAxis xpathAxis, XPathNodeType nodeType, string? prefix, string? name) { _typeDonor = null; if (xpathAxis == XPathAxis.Self && nodeType == XPathNodeType.All && prefix == null && name == null) @@ -1031,20 +1031,20 @@ public virtual XslFlags Axis(XPathAxis xpathAxis, XPathNodeType nodeType, string } // "left/right" - public virtual XslFlags JoinStep(XslFlags left, XslFlags right) + public XslFlags JoinStep(XslFlags left, XslFlags right) { _typeDonor = null; return (left & ~XslFlags.TypeFilter) | XslFlags.Nodeset; // "ex:Foo(position())/Bar" } // "nodeset[predicate]" - public virtual XslFlags Predicate(XslFlags nodeset, XslFlags predicate, bool isReverseStep) + public XslFlags Predicate(XslFlags nodeset, XslFlags predicate, bool isReverseStep) { _typeDonor = null; return (nodeset & ~XslFlags.TypeFilter) | XslFlags.Nodeset | (predicate & XslFlags.SideEffects); // "ex:Foo(position())[Bar]" } - public virtual XslFlags Variable(string prefix, string name) + public XslFlags Variable(string prefix, string name) { _typeDonor = ResolveVariable(prefix, name); if (_typeDonor == null) @@ -1054,7 +1054,7 @@ public virtual XslFlags Variable(string prefix, string name) return XslFlags.None; } - public virtual XslFlags Function(string prefix, string name, IList args) + public XslFlags Function(string prefix, string name, IList args) { _typeDonor = null; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs index a92349ad85fb4..f203642824f61 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltInput.cs @@ -12,7 +12,7 @@ namespace System.Xml.Xsl.Xslt // a) Forward only, one pass. // b) You should call MoveToFirstChildren on nonempty element node. (or may be skip) - internal class XsltInput : IErrorHelper + internal sealed class XsltInput : IErrorHelper { #if DEBUG private const int InitRecordsSize = 1; @@ -1134,7 +1134,7 @@ private void ReportNYI(string arg) // -------------------------------- ContextInfo ------------------------------------ - internal class ContextInfo + internal sealed class ContextInfo { public NsDecl? nsList; public ISourceLineInfo? lineInfo; // Line info for whole start tag @@ -1187,7 +1187,7 @@ public void SaveExtendedLineInfo(XsltInput input) } // We need this wrapper class because elementTagLi is not yet calculated - internal class EmptyElementEndTag : ISourceLineInfo + internal sealed class EmptyElementEndTag : ISourceLineInfo { private readonly ISourceLineInfo _elementTagLi; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltLoader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltLoader.cs index da0c17a1febeb..ce66ff1592666 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltLoader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltLoader.cs @@ -21,7 +21,7 @@ namespace System.Xml.Xsl.Xslt using QName = XsltInput.DelayedQName; using XsltAttribute = XsltInput.XsltAttribute; - internal class XsltLoader : IErrorHelper + internal sealed class XsltLoader : IErrorHelper { private Compiler _compiler = null!; private XmlResolver _xmlResolver = null!; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltQilFactory.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltQilFactory.cs index 909d0f8a7cade..e8e8b9be0f381 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltQilFactory.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Xslt/XsltQilFactory.cs @@ -12,7 +12,7 @@ namespace System.Xml.Xsl.Xslt { using T = XmlQueryTypeFactory; - internal class XsltQilFactory : XPathQilFactory + internal sealed class XsltQilFactory : XPathQilFactory { public XsltQilFactory(QilFactory f, bool debug) : base(f, debug) { } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ActionFrame.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ActionFrame.cs index cedc91111e318..3ebd89409062f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ActionFrame.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ActionFrame.cs @@ -11,7 +11,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using MS.Internal.Xml.XPath; - internal class ActionFrame + internal sealed class ActionFrame { private int _state; // Action execution state private int _counter; // Counter, for the use of particular action diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs index 028752efcf66e..5931e93918ed0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/BuilderInfo.cs @@ -11,7 +11,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Diagnostics.CodeAnalysis; - internal class BuilderInfo + internal sealed class BuilderInfo { private string? _name; private string _localName; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ChooseAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ChooseAction.cs index 274ac1be1c29e..2a7935d7d885f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ChooseAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ChooseAction.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Xml.XPath; - internal class ChooseAction : ContainerAction + internal sealed class ChooseAction : ContainerAction { internal override void Compile(Compiler compiler) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs index 9b6c419539596..3c86fe279171a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Compiler.cs @@ -21,7 +21,7 @@ namespace System.Xml.Xsl.XsltOld { - internal class Sort + internal sealed class Sort { internal int select; internal string? lang; @@ -1169,7 +1169,7 @@ public XsltException UnexpectedKeyword() return XsltException.Create(SR.Xslt_UnexpectedKeyword, thisName, parentName); } - internal class ErrorXPathExpression : CompiledXpathExpr + internal sealed class ErrorXPathExpression : CompiledXpathExpr { private readonly string _baseUri; private readonly int _lineNumber, _linePosition; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ContainerAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ContainerAction.cs index aaa95f7190d2d..e315c71d0d52c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ContainerAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ContainerAction.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.XsltOld using System.Runtime.Versioning; using System.Diagnostics.CodeAnalysis; - internal class NamespaceInfo + internal sealed class NamespaceInfo { internal string? prefix; internal string? nameSpace; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/CopyCodeAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/CopyCodeAction.cs index 3234ebc3ae9c0..83e63af5e4b83 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/CopyCodeAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/CopyCodeAction.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Collections; - internal class CopyCodeAction : Action + internal sealed class CopyCodeAction : Action { // Execution states: private const int Outputting = 2; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/DbgCompiler.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/DbgCompiler.cs index 2b291de2325cc..0c07a1988ab46 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/DbgCompiler.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/DbgCompiler.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Xml.Xsl.XsltOld.Debugger; - internal class DbgData + internal sealed class DbgData { private VariableAction[] _variables; public XPathNavigator StyleSheet { get; } @@ -32,7 +32,7 @@ private DbgData() public static DbgData Empty { get { return s_nullDbgData; } } } - internal class DbgCompiler : Compiler + internal sealed class DbgCompiler : Compiler { private readonly IXsltDebugger _debugger; @@ -54,7 +54,7 @@ public DbgCompiler(IXsltDebugger debugger) private readonly ArrayList _localVars = new ArrayList(); private VariableAction[]? _globalVarsCache, _localVarsCache; - public virtual VariableAction[] GlobalVariables + public VariableAction[] GlobalVariables { get { @@ -66,7 +66,7 @@ public virtual VariableAction[] GlobalVariables return _globalVarsCache; } } - public virtual VariableAction[] LocalVariables + public VariableAction[] LocalVariables { get { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/EndEvent.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/EndEvent.cs index 1e831a9a5eb2f..753787a893d0e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/EndEvent.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/EndEvent.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Xml.XPath; - internal class EndEvent : Event + internal sealed class EndEvent : Event { private readonly XPathNodeType _nodeType; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/HtmlProps.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/HtmlProps.cs index 7ae3808c59185..eb507621140bc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/HtmlProps.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/HtmlProps.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Globalization; - internal class HtmlElementProps + internal sealed class HtmlElementProps { private bool _empty; private bool _abrParent; @@ -133,7 +133,7 @@ private static Hashtable CreatePropsTable() } } - internal class HtmlAttributeProps + internal sealed class HtmlAttributeProps { private bool _abr; private bool _uri; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScope.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScope.cs index 93601bbb1908f..08ad280514f43 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScope.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScope.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Collections; - internal class InputScope : DocumentScope + internal sealed class InputScope : DocumentScope { private InputScope? _parent; private bool _forwardCompatibility; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScopeManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScopeManager.cs index 25acce1c6ae40..5d2e8988b4e32 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScopeManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/InputScopeManager.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Xml.XPath; - internal class InputScopeManager + internal sealed class InputScopeManager { private InputScope? _scopeStack; private string _defaultNS = string.Empty; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NameSpaceEvent.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NameSpaceEvent.cs index 57002bcfac1a7..32c5d8090b54d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NameSpaceEvent.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NameSpaceEvent.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Xml.XPath; - internal class NamespaceEvent : Event + internal sealed class NamespaceEvent : Event { private string _namespaceUri; private string _name; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NamespaceDecl.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NamespaceDecl.cs index a709a4e16a544..a4601f1aa1438 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NamespaceDecl.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NamespaceDecl.cs @@ -7,7 +7,7 @@ namespace System.Xml.Xsl.XsltOld using System.Diagnostics.CodeAnalysis; using System.Xml; - internal class NamespaceDecl + internal sealed class NamespaceDecl { private string _prefix; private string _nsUri; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorInput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorInput.cs index e149f0118fc5e..8d1497f60aa46 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorInput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NavigatorInput.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using KeywordsTable = System.Xml.Xsl.Xslt.KeywordsTable; - internal class NavigatorInput + internal sealed class NavigatorInput { private XPathNavigator? _Navigator; private PositionInfo? _PositionInfo; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NumberAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NumberAction.cs index 5228a2861e556..f118809686f9d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NumberAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/NumberAction.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.XsltOld { internal class NumberAction : ContainerAction { - internal class FormatInfo + internal sealed class FormatInfo { public bool isSeparator; // False for alphanumeric strings of chars public NumberingSequence numSequence; // Specifies numbering sequence diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutKeywords.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutKeywords.cs index 813f36473c3fe..4ec228d48d16c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutKeywords.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutKeywords.cs @@ -7,7 +7,7 @@ namespace System.Xml.Xsl.XsltOld using System.Diagnostics; using System.Xml; - internal class OutKeywords + internal sealed class OutKeywords { #if DEBUG private readonly XmlNameTable _NameTable; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScope.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScope.cs index c978824e63669..9f8f3d8d3c1f8 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScope.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScope.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Diagnostics.CodeAnalysis; using System.Xml; - internal class OutputScope : DocumentScope + internal sealed class OutputScope : DocumentScope { private string _name; private string _nsUri; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScopeManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScopeManager.cs index 12cb000164494..8cce6af5e27e2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScopeManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/OutputScopeManager.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Diagnostics; using System.Xml; - internal class OutputScopeManager + internal sealed class OutputScopeManager { private const int STACK_INCREMENT = 10; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Processor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Processor.cs index e9274d40a16a7..4a8075b0dcf6d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Processor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Processor.cs @@ -1073,7 +1073,7 @@ internal void ResetParams() // ---------------------- Debugger stack ----------------------- - internal class DebuggerFrame + internal sealed class DebuggerFrame { internal ActionFrame? actionFrame; internal XmlQualifiedName? currentMode; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs index d1b684a3f0ee7..718a6be718ca5 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/RootAction.cs @@ -14,7 +14,7 @@ namespace System.Xml.Xsl.XsltOld using MS.Internal.Xml.XPath; using System.Security; - internal class Key + internal sealed class Key { private readonly XmlQualifiedName _name; private readonly int _matchKey; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StateMachine.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StateMachine.cs index 00027965e4c4d..9b1d337da6624 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StateMachine.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StateMachine.cs @@ -8,7 +8,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Xml.XPath; - internal class StateMachine + internal sealed class StateMachine { // Constants for the state table private const int Init = 0x000000; // Initial state diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StringOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StringOutput.cs index 1856daed82c2c..d5af900e9cb4c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StringOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/StringOutput.cs @@ -7,7 +7,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml; using System.Text; - internal class StringOutput : SequentialOutput + internal sealed class StringOutput : SequentialOutput { private readonly StringBuilder _builder; private string? _result; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Stylesheet.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Stylesheet.cs index 5c82f4e742b22..18ce1a7600fce 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Stylesheet.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/Stylesheet.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Collections; - internal class Stylesheet + internal sealed class Stylesheet { private readonly ArrayList _imports = new ArrayList(); private Hashtable? _modeManagers; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs index 8715505643d70..4b73d0950126c 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateLookupAction.cs @@ -94,7 +94,7 @@ internal override void Execute(Processor processor, ActionFrame frame) } } - internal class TemplateLookupActionDbg : TemplateLookupAction + internal sealed class TemplateLookupActionDbg : TemplateLookupAction { internal override void Execute(Processor processor, ActionFrame frame) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateManager.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateManager.cs index 488c32048d580..da0553266686f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateManager.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TemplateManager.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Collections; - internal class TemplateManager + internal sealed class TemplateManager { private readonly XmlQualifiedName _mode; internal ArrayList? templates; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TextOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TextOutput.cs index bed1a25a468c3..15360671a3ac9 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TextOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/TextOutput.cs @@ -9,7 +9,7 @@ namespace System.Xml.Xsl.XsltOld using System.Xml.XPath; using System.Text; - internal class TextOutput : SequentialOutput + internal sealed class TextOutput : SequentialOutput { private TextWriter _writer; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ValueOfAction.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ValueOfAction.cs index 719b0c747bce0..dfa60089a214e 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ValueOfAction.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/ValueOfAction.cs @@ -87,7 +87,7 @@ internal override void Execute(Processor processor, ActionFrame frame) } } - internal class BuiltInRuleTextAction : Action + internal sealed class BuiltInRuleTextAction : Action { private const int ResultStored = 2; internal override void Execute(Processor processor, ActionFrame frame) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltCompileContext.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltCompileContext.cs index 31fc3a7196ade..ef58b3d968f23 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltCompileContext.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltCompileContext.cs @@ -15,7 +15,7 @@ namespace System.Xml.Xsl.XsltOld using System.Runtime.Versioning; using System.Diagnostics.CodeAnalysis; - internal class XsltCompileContext : XsltContext + internal sealed class XsltCompileContext : XsltContext { private InputScopeManager? _manager; private Processor? _processor; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltOutput.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltOutput.cs index ee25af7352232..d90674571eb42 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltOutput.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XsltOld/XsltOutput.cs @@ -10,7 +10,7 @@ namespace System.Xml.Xsl.XsltOld using System.Text; using System.Collections; - internal class XsltOutput : CompiledAction + internal sealed class XsltOutput : CompiledAction { internal enum OutputMethod { diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomAssembly.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomAssembly.cs index a6d9f249b6b5d..3576d5d60427d 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomAssembly.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomAssembly.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomAssembly : ProjectingAssembly + internal sealed class CustomAssembly : ProjectingAssembly { public CustomAssembly(Assembly template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomConstructorInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomConstructorInfo.cs index c036fb11d9762..f1a65cf18ec8c 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomConstructorInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomConstructorInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomConstructorInfo : ProjectingConstructorInfo + internal sealed class CustomConstructorInfo : ProjectingConstructorInfo { public CustomConstructorInfo(ConstructorInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomEventInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomEventInfo.cs index 3ca8423cd26ca..e14c82ef5616f 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomEventInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomEventInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomEventInfo : ProjectingEventInfo + internal sealed class CustomEventInfo : ProjectingEventInfo { public CustomEventInfo(EventInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomFieldInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomFieldInfo.cs index d4f2b7f637487..764a9dcb46a9f 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomFieldInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomFieldInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomFieldInfo : ProjectingFieldInfo + internal sealed class CustomFieldInfo : ProjectingFieldInfo { public CustomFieldInfo(FieldInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomMethodInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomMethodInfo.cs index 964830b5388b2..c73d0d65efc82 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomMethodInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomMethodInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomMethodInfo : ProjectingMethodInfo + internal sealed class CustomMethodInfo : ProjectingMethodInfo { public CustomMethodInfo(MethodInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomModule.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomModule.cs index abf6f1c449c5a..05ec843cc81ce 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomModule.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomModule.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomModule : ProjectingModule + internal sealed class CustomModule : ProjectingModule { public CustomModule(Module template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomParameterInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomParameterInfo.cs index f09098c12214c..ba2229c3ee730 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomParameterInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomParameterInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomParameterInfo : ProjectingParameterInfo + internal sealed class CustomParameterInfo : ProjectingParameterInfo { public CustomParameterInfo(ParameterInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomPropertyInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomPropertyInfo.cs index cac49fff02aa9..396404af651dc 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomPropertyInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomPropertyInfo.cs @@ -5,7 +5,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomPropertyInfo : ProjectingPropertyInfo + internal sealed class CustomPropertyInfo : ProjectingPropertyInfo { public CustomPropertyInfo(PropertyInfo template, CustomReflectionContext context) : base(template, context.Projector) diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs index bf6d6ffd60a96..ea2d3ae2ee553 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Custom/CustomType.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Custom { - internal class CustomType : ProjectingType + internal sealed class CustomType : ProjectingType { private IEnumerable _newProperties; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/CustomReflectionContext.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/CustomReflectionContext.cs index 2676cf631b558..4ff6bef37c016 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/CustomReflectionContext.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/CustomReflectionContext.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context { - internal class IdentityReflectionContext : ReflectionContext + internal sealed class IdentityReflectionContext : ReflectionContext { public override Assembly MapAssembly(Assembly assembly) { return assembly; } public override TypeInfo MapType(TypeInfo type) { return type; } diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingCustomAttributeData.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingCustomAttributeData.cs index ac392a35b01a2..d086cef1452fd 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingCustomAttributeData.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingCustomAttributeData.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given custom attribute data - internal class ProjectingCustomAttributeData : DelegatingCustomAttributeData + internal sealed class ProjectingCustomAttributeData : DelegatingCustomAttributeData { private readonly Projector _projector; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingExceptionHandlingClause.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingExceptionHandlingClause.cs index 255b082f6af44..bcc74828a26b1 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingExceptionHandlingClause.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingExceptionHandlingClause.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given exception handling clause - internal class ProjectingExceptionHandlingClause : DelegatingExceptionHandlingClause + internal sealed class ProjectingExceptionHandlingClause : DelegatingExceptionHandlingClause { private readonly Projector _projector; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingLocalVariableInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingLocalVariableInfo.cs index e1003de06052d..0e8d3d170787f 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingLocalVariableInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingLocalVariableInfo.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given variable - internal class ProjectingLocalVariableInfo : DelegatingLocalVariableInfo + internal sealed class ProjectingLocalVariableInfo : DelegatingLocalVariableInfo { private readonly Projector _projector; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingManifestResourceInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingManifestResourceInfo.cs index 734efef1ff051..32b9b1831dfc2 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingManifestResourceInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingManifestResourceInfo.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given resource - internal class ProjectingManifestResourceInfo : DelegatingManifestResourceInfo + internal sealed class ProjectingManifestResourceInfo : DelegatingManifestResourceInfo { private readonly Projector _projector; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingMethodBody.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingMethodBody.cs index 28e94fa661fb8..5d137e403fc24 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingMethodBody.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingMethodBody.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given method body - internal class ProjectingMethodBody : DelegatingMethodBody + internal sealed class ProjectingMethodBody : DelegatingMethodBody { private readonly Projector _projector; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedMethodInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedMethodInfo.cs index 734fbe4f8f1d1..f366517170a98 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedMethodInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedMethodInfo.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Context.Virtual { // Represents a inherited method which is identical to the base method except for its ReflectedType. - internal partial class InheritedMethodInfo : DelegatingMethodInfo + internal sealed partial class InheritedMethodInfo : DelegatingMethodInfo { private readonly Type _reflectedType; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedPropertyInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedPropertyInfo.cs index bc2cc4c67aa89..a4a142399f7e3 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedPropertyInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/InheritedPropertyInfo.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Context.Virtual { // Represents a inherited property which is identical to the base property except for its ReflectedType. - internal partial class InheritedPropertyInfo : DelegatingPropertyInfo + internal sealed partial class InheritedPropertyInfo : DelegatingPropertyInfo { private readonly Type _reflectedType; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertyGetter.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertyGetter.cs index eab4118cebb12..86caee374ed47 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertyGetter.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertyGetter.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Virtual { - internal partial class VirtualPropertyInfo + internal sealed partial class VirtualPropertyInfo { private sealed class PropertyGetter : PropertyGetterBase { diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertySetter.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertySetter.cs index de4cbfe487671..f7b3878d8f416 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertySetter.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.PropertySetter.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Virtual { - internal partial class VirtualPropertyInfo + internal sealed partial class VirtualPropertyInfo { private sealed class PropertySetter : PropertySetterBase { diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.cs index ea21ece64221b..e56f1837c87e4 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualPropertyInfo.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Context.Virtual { // Represents a func-based 'PropertyInfo' - internal partial class VirtualPropertyInfo : VirtualPropertyBase + internal sealed partial class VirtualPropertyInfo : VirtualPropertyBase { private readonly PropertyGetter _getter; private readonly PropertySetter _setter; diff --git a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualReturnParameter.cs b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualReturnParameter.cs index 0f0b8d7b729a9..ac2e91834a413 100644 --- a/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualReturnParameter.cs +++ b/src/libraries/System.Reflection.Context/src/System/Reflection/Context/Virtual/VirtualReturnParameter.cs @@ -4,7 +4,7 @@ namespace System.Reflection.Context.Virtual { // Represents the 'return' parameter for a method - internal class VirtualReturnParameter : VirtualParameter + internal sealed class VirtualReturnParameter : VirtualParameter { public VirtualReturnParameter(MethodInfo method) : base(method, method.ReturnType, name:null, position: -1) diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PooledStringBuilder.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PooledStringBuilder.cs index 05ab60bb2baf8..74118090fad57 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PooledStringBuilder.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/Utilities/PooledStringBuilder.cs @@ -14,7 +14,7 @@ namespace System.Reflection.Internal /// ... sb.ToString() ... /// inst.Free(); /// - internal class PooledStringBuilder + internal sealed class PooledStringBuilder { public readonly StringBuilder Builder = new StringBuilder(); private readonly ObjectPool _pool; diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/NamespaceCache.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/NamespaceCache.cs index 5a57bc2c78cf9..6aa8c6eae8dcc 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/NamespaceCache.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Internal/NamespaceCache.cs @@ -8,7 +8,7 @@ namespace System.Reflection.Metadata.Ecma335 { - internal class NamespaceCache + internal sealed class NamespaceCache { private readonly MetadataReader _metadataReader; private readonly object _namespaceTableAndListLock = new object(); diff --git a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs index 532f47737fa6a..ea9fbb4410376 100644 --- a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs +++ b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/DeserializingResourceReader.cs @@ -48,7 +48,7 @@ private object ReadBinaryFormattedObject() } - internal class UndoTruncatedTypeNameSerializationBinder : SerializationBinder + internal sealed class UndoTruncatedTypeNameSerializationBinder : SerializationBinder { public override Type? BindToType(string assemblyName, string typeName) { diff --git a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/PreserializedResourceWriter.cs b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/PreserializedResourceWriter.cs index 0d4e5d7185b71..53f58ab2ba72f 100644 --- a/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/PreserializedResourceWriter.cs +++ b/src/libraries/System.Resources.Extensions/src/System/Resources/Extensions/PreserializedResourceWriter.cs @@ -8,7 +8,7 @@ namespace System.Resources.Extensions { - internal class UnknownType { } + internal sealed class UnknownType { } public partial class PreserializedResourceWriter { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs index fa093a5a305bf..4b6df845ef503 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs @@ -854,7 +854,7 @@ internal int FlushUnderUsedItems(int maxFlush, bool force) } } - internal class CacheUsage + internal sealed class CacheUsage { internal static readonly TimeSpan NEWADD_INTERVAL = new TimeSpan(0, 0, 10); internal static readonly TimeSpan CORRELATED_REQUEST_TIMEOUT = new TimeSpan(0, 0, 1); diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs index 451cdba34866e..339169a4c45ed 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/FileChangeNotificationSystem.cs @@ -15,12 +15,12 @@ internal sealed class FileChangeNotificationSystem : IFileChangeNotificationSyst private readonly Hashtable _dirMonitors; private readonly object _lock; - internal class DirectoryMonitor + internal sealed class DirectoryMonitor { internal FileSystemWatcher Fsw; } - internal class FileChangeEventTarget + internal sealed class FileChangeEventTarget { private readonly string _fileName; private readonly OnChangedCallback _onChangedCallback; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs index 901ec46d47bab..b17bf5ff94101 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheEntry.cs @@ -11,7 +11,7 @@ namespace System.Runtime.Caching { - internal class MemoryCacheEntry : MemoryCacheKey + internal sealed class MemoryCacheEntry : MemoryCacheKey { private readonly object _value; private readonly DateTime _utcCreated; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheKeyEqualityComparer.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheKeyEqualityComparer.cs index 8d7650f820e93..c7d0173724dcc 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheKeyEqualityComparer.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/MemoryCacheKeyEqualityComparer.cs @@ -6,7 +6,7 @@ namespace System.Runtime.Caching { - internal class MemoryCacheEqualityComparer : IEqualityComparer + internal sealed class MemoryCacheEqualityComparer : IEqualityComparer { bool IEqualityComparer.Equals(object x, object y) { diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs index 6c908fd4874c3..b002740316335 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SRef.cs @@ -11,7 +11,7 @@ namespace System.Runtime.Caching { // until then we provide a stub - internal class SRefMultiple + internal sealed class SRefMultiple { internal SRefMultiple(object[] targets) { @@ -22,7 +22,7 @@ internal void Dispose() } } - internal class GCHandleRef : IDisposable + internal sealed class GCHandleRef : IDisposable where T : class, IDisposable { private GCHandle _handle; diff --git a/src/libraries/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs b/src/libraries/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs index 3f6a2e33363c3..9f4f62cf64fd8 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/Globalization/FormatProvider.NumberBuffer.cs @@ -6,7 +6,7 @@ namespace System.Globalization { - internal partial class FormatProvider + internal static partial class FormatProvider { private static partial class Number { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs index 042a5f6efc7a9..1c7fbb1ea71f9 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.OSX.cs @@ -5,7 +5,7 @@ namespace Internal.Cryptography { - internal partial class AesImplementation + internal sealed partial class AesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs index 24dce8379f15b..378b4cf0c1121 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Unix.cs @@ -6,7 +6,7 @@ namespace Internal.Cryptography { - internal partial class AesImplementation + internal sealed partial class AesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs index f08ecbb6780a1..953bcde1cc132 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/AesImplementation.Windows.cs @@ -6,7 +6,7 @@ namespace Internal.Cryptography { - internal partial class AesImplementation + internal sealed partial class AesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs index fc88b0a4431cf..72714b4cf3eb7 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.OSX.cs @@ -5,7 +5,7 @@ namespace Internal.Cryptography { - internal partial class DesImplementation + internal sealed partial class DesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs index 7bf051e669dfa..2baa3062ea5ef 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Unix.cs @@ -7,7 +7,7 @@ namespace Internal.Cryptography { - internal partial class DesImplementation + internal sealed partial class DesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs index a6d53c6e8879f..dba5858591c3d 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/DesImplementation.Windows.cs @@ -6,7 +6,7 @@ namespace Internal.Cryptography { - internal partial class DesImplementation + internal sealed partial class DesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs index 6adbec36bb8f9..92eae5679d7b4 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/OpenSslCipher.cs @@ -11,7 +11,7 @@ namespace Internal.Cryptography { - internal class OpenSslCipher : BasicSymmetricCipher + internal sealed class OpenSslCipher : BasicSymmetricCipher { private readonly bool _encrypting; private SafeEvpCipherCtxHandle _ctx; diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs index dad0dce87c8fc..1473dc7ca3bd1 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.OSX.cs @@ -5,7 +5,7 @@ namespace Internal.Cryptography { - internal partial class RC2Implementation + internal sealed partial class RC2Implementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs index 3e2a12794ceec..6e77674161c28 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Unix.cs @@ -7,7 +7,7 @@ namespace Internal.Cryptography { - internal partial class RC2Implementation + internal sealed partial class RC2Implementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs index 0c6139a3f36de..5c038c325d503 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RC2Implementation.Windows.cs @@ -7,7 +7,7 @@ namespace Internal.Cryptography { - internal partial class RC2Implementation + internal sealed partial class RC2Implementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs index daedb5dcc503c..1c68004362dfb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Browser.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography { - internal partial class RandomNumberGeneratorImplementation + internal sealed partial class RandomNumberGeneratorImplementation { private static unsafe void GetBytes(byte* pbBuffer, int count) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs index f66da266b9223..3bb1cd89143e8 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.OSX.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography { - internal partial class RandomNumberGeneratorImplementation + internal sealed partial class RandomNumberGeneratorImplementation { private static unsafe void GetBytes(byte* pbBuffer, int count) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs index 73aed5126ab8c..d8ef68a61648b 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Unix.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography { - internal partial class RandomNumberGeneratorImplementation + internal sealed partial class RandomNumberGeneratorImplementation { private static unsafe void GetBytes(byte* pbBuffer, int count) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs index 87a7ca45c526c..876111a4ef45a 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.Windows.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography { - internal partial class RandomNumberGeneratorImplementation + internal sealed partial class RandomNumberGeneratorImplementation { private static unsafe void GetBytes(byte* pbBuffer, int count) { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs index 1284943c323c5..34d3dcf4978fb 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.OSX.cs @@ -5,7 +5,7 @@ namespace Internal.Cryptography { - internal partial class TripleDesImplementation + internal sealed partial class TripleDesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs index 2efa80141eb8a..2044b3f596351 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Unix.cs @@ -6,7 +6,7 @@ namespace Internal.Cryptography { - internal partial class TripleDesImplementation + internal sealed partial class TripleDesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs index 331162e7ea8f9..b6ea4fca90585 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/TripleDesImplementation.Windows.cs @@ -6,7 +6,7 @@ namespace Internal.Cryptography { - internal partial class TripleDesImplementation + internal sealed partial class TripleDesImplementation { private static ICryptoTransform CreateTransformCore( CipherMode cipherMode, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.Windows.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.Windows.cs index f3eab04b8717a..ef7bbd6f0bc15 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.Windows.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AesAEAD.Windows.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography { - internal partial class AesAEAD + internal static partial class AesAEAD { public static unsafe void Encrypt( SafeAlgorithmHandle algorithm, diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs index b4497cc57de8c..c7c38e7bcc4ca 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/CngKeyLite.cs @@ -716,15 +716,15 @@ internal class SafeNCryptKeyHandle : SafeNCryptHandle { } - internal class SafeNCryptProviderHandle : SafeNCryptHandle + internal sealed class SafeNCryptProviderHandle : SafeNCryptHandle { } - internal class SafeNCryptSecretHandle : SafeNCryptHandle + internal sealed class SafeNCryptSecretHandle : SafeNCryptHandle { } - internal class DuplicateSafeNCryptKeyHandle : SafeNCryptKeyHandle + internal sealed class DuplicateSafeNCryptKeyHandle : SafeNCryptKeyHandle { public DuplicateSafeNCryptKeyHandle(SafeNCryptKeyHandle original) : base() diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs b/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs index a84762d7a765f..0275ab5546bab 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs +++ b/src/libraries/System.Security.Cryptography.Encoding/src/Internal/Cryptography/AsnFormatter.Managed.cs @@ -14,7 +14,7 @@ internal abstract partial class AsnFormatter private static readonly AsnFormatter s_instance = new ManagedAsnFormatter(); } - internal class ManagedAsnFormatter : AsnFormatter + internal sealed class ManagedAsnFormatter : AsnFormatter { protected override string? FormatNative(Oid? oid, byte[] rawData, bool multiLine) { diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs index 9a4a92a65a6b4..cac04b086150e 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System/Security/Cryptography/Pkcs/CmsSignature.ECDsa.cs @@ -20,7 +20,7 @@ static partial void PrepareRegistrationECDsa(Dictionary lo lookup.Add(Oids.EcPublicKey, new ECDsaCmsSignature(null, default)); } - private partial class ECDsaCmsSignature : CmsSignature + private sealed partial class ECDsaCmsSignature : CmsSignature { private readonly HashAlgorithmName _expectedDigest; private readonly string? _signatureAlgorithm; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/FindPal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/FindPal.cs index 96b743817f8d6..0cdbbe6555ebe 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/FindPal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/FindPal.cs @@ -10,7 +10,7 @@ namespace Internal.Cryptography.Pal { - internal partial class FindPal + internal sealed partial class FindPal { private const int NamedKeyUsageFlagsCount = 9; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Android/X509Pal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Android/X509Pal.cs index 53956f55c4960..370127735235b 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Android/X509Pal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Android/X509Pal.cs @@ -19,7 +19,7 @@ private X509Pal() { } - private partial class AndroidX509Pal : ManagedX509ExtensionProcessor, IX509Pal + private sealed partial class AndroidX509Pal : ManagedX509ExtensionProcessor, IX509Pal { public ECDsa DecodeECDsaPublicKey(ICertificatePal? certificatePal) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/X509Pal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/X509Pal.cs index cd2db47497703..c730b7ff5b6f7 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/X509Pal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.OSX/X509Pal.cs @@ -21,7 +21,7 @@ private X509Pal() { } - private partial class AppleX509Pal : ManagedX509ExtensionProcessor, IX509Pal + private sealed partial class AppleX509Pal : ManagedX509ExtensionProcessor, IX509Pal { public ECDsa DecodeECDsaPublicKey(ICertificatePal? certificatePal) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs index 8915e3469ae5f..0b55ca7d319d2 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/FindPal.cs @@ -14,7 +14,7 @@ namespace Internal.Cryptography.Pal { - internal partial class FindPal : IFindPal + internal sealed partial class FindPal : IFindPal { private readonly StorePal _storePal; private readonly X509Certificate2Collection _copyTo; diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Pkcs10CertificationRequestInfo.cs b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Pkcs10CertificationRequestInfo.cs index ec179f3ad0dfc..963ec96438197 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Pkcs10CertificationRequestInfo.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/Pkcs10CertificationRequestInfo.cs @@ -11,7 +11,7 @@ namespace System.Security.Cryptography.X509Certificates { - internal class Pkcs10CertificationRequestInfo + internal sealed class Pkcs10CertificationRequestInfo { internal X500DistinguishedName Subject { get; set; } internal PublicKey PublicKey { get; set; } diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AttributeSortOrder.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AttributeSortOrder.cs index 3c40f356f5fad..c0ff1120f8b18 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AttributeSortOrder.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/AttributeSortOrder.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // This class does lexicographic sorting by NamespaceURI first and then by LocalName. - internal class AttributeSortOrder : IComparer + internal sealed class AttributeSortOrder : IComparer { internal AttributeSortOrder() { } diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/C14NAncestralNamespaceContextManager.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/C14NAncestralNamespaceContextManager.cs index 88574cc22f47c..9eb170965b7e5 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/C14NAncestralNamespaceContextManager.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/C14NAncestralNamespaceContextManager.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.Xml { // the stack of currently active NamespaceFrame contexts. this // object also maintains the inclusive prefix list in a tokenized form. - internal class C14NAncestralNamespaceContextManager : AncestralNamespaceContextManager + internal sealed class C14NAncestralNamespaceContextManager : AncestralNamespaceContextManager { internal C14NAncestralNamespaceContextManager() { } diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXml.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXml.cs index 3ccf5ccecd878..e55dd306cc0a5 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXml.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXml.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { - internal class CanonicalXml + internal sealed class CanonicalXml { private readonly CanonicalXmlDocument _c14nDoc; private readonly C14NAncestralNamespaceContextManager _ancMgr; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlAttribute.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlAttribute.cs index 3fe25246c8135..ed06c365672b2 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlAttribute.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlAttribute.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlAttribute - internal class CanonicalXmlAttribute : XmlAttribute, ICanonicalizableNode + internal sealed class CanonicalXmlAttribute : XmlAttribute, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlCDataSection.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlCDataSection.cs index f85f79d7989c7..ff5d9d4529150 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlCDataSection.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlCDataSection.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlCDataSection - internal class CanonicalXmlCDataSection : XmlCDataSection, ICanonicalizableNode + internal sealed class CanonicalXmlCDataSection : XmlCDataSection, ICanonicalizableNode { private bool _isInNodeSet; public CanonicalXmlCDataSection(string data, XmlDocument doc, bool defaultNodeSetInclusionState) : base(data, doc) diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlComment.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlComment.cs index b14a4b7ce3b82..99c4a2fdbcd7f 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlComment.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlComment.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlComment - internal class CanonicalXmlComment : XmlComment, ICanonicalizableNode + internal sealed class CanonicalXmlComment : XmlComment, ICanonicalizableNode { private bool _isInNodeSet; private readonly bool _includeComments; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlDocument.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlDocument.cs index 12caec4df1889..9713d998428f2 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlDocument.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlDocument.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.Xml { // all input types eventually lead to the creation of an XmlDocument document // of this type. it maintains the node subset state and performs output rendering during canonicalization - internal class CanonicalXmlDocument : XmlDocument, ICanonicalizableNode + internal sealed class CanonicalXmlDocument : XmlDocument, ICanonicalizableNode { private readonly bool _defaultNodeSetInclusionState; private readonly bool _includeComments; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlElement.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlElement.cs index 3b876fc4e6f43..fb1f9c599cfda 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlElement.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlElement.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlElement - internal class CanonicalXmlElement : XmlElement, ICanonicalizableNode + internal sealed class CanonicalXmlElement : XmlElement, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlEntityReference.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlEntityReference.cs index b3439b42e11e0..f6ae518d57e74 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlEntityReference.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlEntityReference.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlEntityReference - internal class CanonicalXmlEntityReference : XmlEntityReference, ICanonicalizableNode + internal sealed class CanonicalXmlEntityReference : XmlEntityReference, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlNodeList.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlNodeList.cs index 6d09ff769099e..e1308ea884980 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlNodeList.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlNodeList.cs @@ -6,7 +6,7 @@ namespace System.Security.Cryptography.Xml { - internal class CanonicalXmlNodeList : XmlNodeList, IList + internal sealed class CanonicalXmlNodeList : XmlNodeList, IList { private readonly ArrayList _nodeArray; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlProcessingInstruction.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlProcessingInstruction.cs index af0939e8a7ade..2bc2502eb9f67 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlProcessingInstruction.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlProcessingInstruction.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlProcessingInstruction - internal class CanonicalXmlProcessingInstruction : XmlProcessingInstruction, ICanonicalizableNode + internal sealed class CanonicalXmlProcessingInstruction : XmlProcessingInstruction, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlSignificantWhitespace.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlSignificantWhitespace.cs index 26fa26c93adf9..cd4ec4820e247 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlSignificantWhitespace.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlSignificantWhitespace.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlSignificantWhitespace - internal class CanonicalXmlSignificantWhitespace : XmlSignificantWhitespace, ICanonicalizableNode + internal sealed class CanonicalXmlSignificantWhitespace : XmlSignificantWhitespace, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlText.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlText.cs index 23b43b269e2be..90982628d4be3 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlText.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlText.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlText - internal class CanonicalXmlText : XmlText, ICanonicalizableNode + internal sealed class CanonicalXmlText : XmlText, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlWhitespace.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlWhitespace.cs index c15b186badee0..38fae307ed4dc 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlWhitespace.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/CanonicalXmlWhitespace.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { // the class that provides node subset state and canonicalization function to XmlWhitespace - internal class CanonicalXmlWhitespace : XmlWhitespace, ICanonicalizableNode + internal sealed class CanonicalXmlWhitespace : XmlWhitespace, ICanonicalizableNode { private bool _isInNodeSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs index 27a27ca8b2526..1d3fe08ab8dde 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/DSASignatureDescription.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography.Xml { - internal class DSASignatureDescription : SignatureDescription + internal sealed class DSASignatureDescription : SignatureDescription { private const string HashAlgorithm = "SHA1"; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcAncestralNamespaceContextManager.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcAncestralNamespaceContextManager.cs index 93319b74346ba..eadbdbf565ed9 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcAncestralNamespaceContextManager.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcAncestralNamespaceContextManager.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography.Xml { // the stack of currently active NamespaceFrame contexts. this // object also maintains the inclusive prefix list in a tokenized form. - internal class ExcAncestralNamespaceContextManager : AncestralNamespaceContextManager + internal sealed class ExcAncestralNamespaceContextManager : AncestralNamespaceContextManager { private readonly Hashtable _inclusivePrefixSet; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcCanonicalXml.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcCanonicalXml.cs index 29488e29688e2..90dde6370104c 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcCanonicalXml.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/ExcCanonicalXml.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography.Xml { - internal class ExcCanonicalXml + internal sealed class ExcCanonicalXml { private readonly CanonicalXmlDocument _c14nDoc; private readonly ExcAncestralNamespaceContextManager _ancMgr; diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs index 2911787c07e65..808a3bbbd777f 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/MyXmlDocument.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography.Xml { - internal class MyXmlDocument : XmlDocument + internal sealed class MyXmlDocument : XmlDocument { protected override XmlAttribute CreateDefaultAttribute(string prefix, string localName, string namespaceURI) { diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceFrame.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceFrame.cs index 2a8ce37fd1a2d..1af976d8fb8a3 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceFrame.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceFrame.cs @@ -9,7 +9,7 @@ namespace System.Security.Cryptography.Xml // the namespaces context corresponding to one XmlElement. the rendered list contains the namespace nodes that are actually // rendered to the canonicalized output. the unrendered list contains the namespace nodes that are in the node set and have // the XmlElement as the owner, but are not rendered. - internal class NamespaceFrame + internal sealed class NamespaceFrame { private readonly Hashtable _rendered = new Hashtable(); private readonly Hashtable _unrendered = new Hashtable(); diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceSortOrder.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceSortOrder.cs index 9973abc00fa8a..1e998ef7e88e2 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceSortOrder.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/NamespaceSortOrder.cs @@ -6,7 +6,7 @@ namespace System.Security.Cryptography.Xml { - internal class NamespaceSortOrder : IComparer + internal sealed class NamespaceSortOrder : IComparer { internal NamespaceSortOrder() { } diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA1SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA1SignatureDescription.cs index a3d92e475d785..82de982f9cd3a 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA1SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA1SignatureDescription.cs @@ -5,7 +5,7 @@ namespace System.Security.Cryptography.Xml { - internal class RSAPKCS1SHA1SignatureDescription : RSAPKCS1SignatureDescription + internal sealed class RSAPKCS1SHA1SignatureDescription : RSAPKCS1SignatureDescription { public RSAPKCS1SHA1SignatureDescription() : base("SHA1") { diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA256SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA256SignatureDescription.cs index a1dd393d79509..21c8967f563b1 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA256SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA256SignatureDescription.cs @@ -3,7 +3,7 @@ namespace System.Security.Cryptography.Xml { - internal class RSAPKCS1SHA256SignatureDescription : RSAPKCS1SignatureDescription + internal sealed class RSAPKCS1SHA256SignatureDescription : RSAPKCS1SignatureDescription { public RSAPKCS1SHA256SignatureDescription() : base("SHA256") { diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA384SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA384SignatureDescription.cs index 758b3b7f77742..9d472c896646f 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA384SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA384SignatureDescription.cs @@ -3,7 +3,7 @@ namespace System.Security.Cryptography.Xml { - internal class RSAPKCS1SHA384SignatureDescription : RSAPKCS1SignatureDescription + internal sealed class RSAPKCS1SHA384SignatureDescription : RSAPKCS1SignatureDescription { public RSAPKCS1SHA384SignatureDescription() : base("SHA384") { diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA512SignatureDescription.cs b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA512SignatureDescription.cs index 5c946e21b07ce..0bc99fcc6c1b6 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA512SignatureDescription.cs +++ b/src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/RSAPKCS1SHA512SignatureDescription.cs @@ -3,7 +3,7 @@ namespace System.Security.Cryptography.Xml { - internal class RSAPKCS1SHA512SignatureDescription : RSAPKCS1SignatureDescription + internal sealed class RSAPKCS1SHA512SignatureDescription : RSAPKCS1SignatureDescription { public RSAPKCS1SHA512SignatureDescription() : base("SHA512") { diff --git a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/IRCollection.cs b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/IRCollection.cs index 4951152f6cd51..489f66d485e5e 100644 --- a/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/IRCollection.cs +++ b/src/libraries/System.Security.Principal.Windows/src/System/Security/Principal/IRCollection.cs @@ -374,7 +374,7 @@ public IdentityReferenceCollection Translate(Type targetType, bool forceSuccess) #endregion } - internal class IdentityReferenceEnumerator : IEnumerator, IDisposable + internal sealed class IdentityReferenceEnumerator : IEnumerator, IDisposable { #region Private members diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Channels/UriGenerator.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Channels/UriGenerator.cs index c1d7778ff97c0..f0e5fb91b2607 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Channels/UriGenerator.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Channels/UriGenerator.cs @@ -6,7 +6,7 @@ namespace System.ServiceModel.Channels { - internal class UriGenerator + internal sealed class UriGenerator { private long _id; private readonly string _prefix; diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/NullNotAllowedCollection.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/NullNotAllowedCollection.cs index b3d9fa52f98d0..0bed469263e6a 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/NullNotAllowedCollection.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/Syndication/NullNotAllowedCollection.cs @@ -5,7 +5,7 @@ namespace System.ServiceModel.Syndication { - internal class NullNotAllowedCollection : Collection where TCollectionItem : class + internal sealed class NullNotAllowedCollection : Collection where TCollectionItem : class { public NullNotAllowedCollection() : base() { diff --git a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs index ab673b242c235..08f68ba039aca 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs +++ b/src/libraries/System.ServiceModel.Syndication/src/System/ServiceModel/XmlBuffer.cs @@ -7,7 +7,7 @@ namespace System.ServiceModel { - internal class XmlBuffer + internal sealed class XmlBuffer { private readonly List
_sections; private byte[] _buffer; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/DBCSCodePageEncoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/DBCSCodePageEncoding.cs index 92da49d2a0c4b..531f26876242a 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/DBCSCodePageEncoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/DBCSCodePageEncoding.cs @@ -1156,7 +1156,7 @@ public override Decoder GetDecoder() return new DBCSDecoder(this); } - internal class DBCSDecoder : DecoderNLS + internal sealed class DBCSDecoder : DecoderNLS { // Need a place for the last left over byte internal byte bLeftOver; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EUCJPEncoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EUCJPEncoding.cs index 1bb05163f67cd..7c4b7485d0c08 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EUCJPEncoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EUCJPEncoding.cs @@ -44,7 +44,7 @@ namespace System.Text { - internal class EUCJPEncoding : DBCSCodePageEncoding + internal sealed class EUCJPEncoding : DBCSCodePageEncoding { // This pretends to be CP 932 as far as memory tables are concerned. public EUCJPEncoding() : base(51932, 932) diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncoderBestFitFallback.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncoderBestFitFallback.cs index 3c42ac90761ea..0d9bed68345d5 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncoderBestFitFallback.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncoderBestFitFallback.cs @@ -14,7 +14,7 @@ namespace System.Text { - internal class InternalEncoderBestFitFallback : EncoderFallback + internal sealed class InternalEncoderBestFitFallback : EncoderFallback { // Our variables internal BaseCodePageEncoding encoding; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingByteBuffer.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingByteBuffer.cs index a2a20b2984f3c..a4a4a0db58fa7 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingByteBuffer.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingByteBuffer.cs @@ -5,7 +5,7 @@ namespace System.Text { - internal class EncodingByteBuffer + internal sealed class EncodingByteBuffer { private unsafe byte* _bytes; private readonly unsafe byte* _byteStart; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs index 38648d08db533..c65756dc34719 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs @@ -5,7 +5,7 @@ namespace System.Text { - internal class EncodingCharBuffer + internal sealed class EncodingCharBuffer { private unsafe char* _chars; private readonly unsafe char* _charStart; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISCIIEncoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISCIIEncoding.cs index 4c8d55e77f0e7..e630706877a36 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISCIIEncoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISCIIEncoding.cs @@ -24,7 +24,7 @@ namespace System.Text // Forms D & KD have things like 0934, which decomposes to 0933 + 093C, so not normal. // Form IDNA has the above problems plus case mapping, so false (like most encodings) // - internal class ISCIIEncoding : EncodingNLS, ISerializable + internal sealed class ISCIIEncoding : EncodingNLS, ISerializable { // Constants private const int CodeDevanagari = 2; // 0x42 57002 @@ -691,7 +691,7 @@ public override int GetHashCode() return _defaultCodePage + EncoderFallback.GetHashCode() + DecoderFallback.GetHashCode(); } - internal class ISCIIEncoder : EncoderNLS + internal sealed class ISCIIEncoder : EncoderNLS { // Need to remember the default code page (for HasState) internal int defaultCodePage; @@ -729,7 +729,7 @@ internal override bool HasState } } - internal class ISCIIDecoder : DecoderNLS + internal sealed class ISCIIDecoder : DecoderNLS { // Need a place to store any our current code page and last ATR flag internal int currentCodePage; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISO2022Encoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISO2022Encoding.cs index cc97ee3c3dab7..84e61cb5620c4 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISO2022Encoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/ISO2022Encoding.cs @@ -47,7 +47,7 @@ namespace System.Text ** ==============================================================================*/ - internal class ISO2022Encoding : DBCSCodePageEncoding + internal sealed class ISO2022Encoding : DBCSCodePageEncoding { private const byte SHIFT_OUT = (byte)0x0E; private const byte SHIFT_IN = (byte)0x0F; @@ -1787,7 +1787,7 @@ public override Decoder GetDecoder() return new ISO2022Decoder(this); } - internal class ISO2022Encoder : System.Text.EncoderNLS + internal sealed class ISO2022Encoder : System.Text.EncoderNLS { internal ISO2022Modes currentMode; internal ISO2022Modes shiftInOutMode; @@ -1819,7 +1819,7 @@ internal override bool HasState } } - internal class ISO2022Decoder : System.Text.DecoderNLS + internal sealed class ISO2022Decoder : System.Text.DecoderNLS { internal byte[] bytesLeftOver = null!; // initialized by base calling Reset internal int bytesLeftOverCount; diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/SBCSCodePageEncoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/SBCSCodePageEncoding.cs index cd969d377e7b3..b0266c6f4ecba 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/SBCSCodePageEncoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/SBCSCodePageEncoding.cs @@ -13,7 +13,7 @@ namespace System.Text { - internal class SBCSCodePageEncoding : BaseCodePageEncoding + internal sealed class SBCSCodePageEncoding : BaseCodePageEncoding { // Pointers to our memory section parts private unsafe char* _mapBytesToUnicode = null; // char 256 diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ArgumentState.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ArgumentState.cs index 77bd0314d0ada..6f3ff576f8a0d 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ArgumentState.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ArgumentState.cs @@ -12,7 +12,7 @@ namespace System.Text.Json /// Holds relevant state when deserializing objects with parameterized constructors. /// Lives on the current ReadStackFrame. /// - internal class ArgumentState + internal sealed class ArgumentState { // Cache for parsed constructor arguments. public object Arguments = null!; diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactory.cs index fe14b9987fd5a..1805f402a93ed 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactory.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IEnumerableConverterFactory.cs @@ -12,7 +12,7 @@ namespace System.Text.Json.Serialization.Converters /// /// Converter factory for all IEnumerable types. /// - internal class IEnumerableConverterFactory : JsonConverterFactory + internal sealed class IEnumerableConverterFactory : JsonConverterFactory { private static readonly IDictionaryConverter s_converterForIDictionary = new IDictionaryConverter(); private static readonly IEnumerableConverter s_converterForIEnumerable = new IEnumerableConverter(); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverterFactory.cs index ae673be6eccc7..2c020f47eebca 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverterFactory.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Object/ObjectConverterFactory.cs @@ -11,7 +11,7 @@ namespace System.Text.Json.Serialization.Converters /// /// Converter factory for all object-based types (non-enumerable and non-primitive). /// - internal class ObjectConverterFactory : JsonConverterFactory + internal sealed class ObjectConverterFactory : JsonConverterFactory { public override bool CanConvert(Type typeToConvert) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs index 81c8e5fd1fec1..64e891b5b0f1f 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs @@ -9,7 +9,7 @@ namespace System.Text.Json.Serialization.Converters { - internal class EnumConverter : JsonConverter + internal sealed class EnumConverter : JsonConverter where T : struct, Enum { private static readonly TypeCode s_enumTypeCode = Type.GetTypeCode(typeof(T)); diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs index 5c1d362f060da..ccdeda1166aef 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverter.cs @@ -5,7 +5,7 @@ namespace System.Text.Json.Serialization.Converters { - internal class NullableConverter : JsonConverter where T : struct + internal sealed class NullableConverter : JsonConverter where T : struct { // It is possible to cache the underlying converter since this is an internal converter and // an instance is created only once for each JsonSerializerOptions instance. diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverterFactory.cs index f42ed1fbcc8c1..c9e659f3d79eb 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverterFactory.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/NullableConverterFactory.cs @@ -7,7 +7,7 @@ namespace System.Text.Json.Serialization.Converters { - internal class NullableConverterFactory : JsonConverterFactory + internal sealed class NullableConverterFactory : JsonConverterFactory { public override bool CanConvert(Type typeToConvert) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonDefaultNamingPolicy.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonDefaultNamingPolicy.cs index 4ab02d1f7117b..300096f5d0047 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonDefaultNamingPolicy.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonDefaultNamingPolicy.cs @@ -3,7 +3,7 @@ namespace System.Text.Json { - internal class JsonDefaultNamingPolicy : JsonNamingPolicy + internal sealed class JsonDefaultNamingPolicy : JsonNamingPolicy { public override string ConvertName(string name) => name; } diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfoOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfoOfT.cs index cca6dfaedb6b2..3693ad0048208 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfoOfT.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonParameterInfoOfT.cs @@ -10,7 +10,7 @@ namespace System.Text.Json /// Represents a strongly-typed parameter to prevent boxing where have less than 4 parameters. /// Holds relevant state like the default value of the parameter, and the position in the method's parameter list. /// - internal class JsonParameterInfo : JsonParameterInfo + internal sealed class JsonParameterInfo : JsonParameterInfo { public T TypedDefaultValue { get; private set; } = default!; diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs index 0022621f04d84..14c46c7f79947 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Internal/Common.cs @@ -662,7 +662,7 @@ internal BoundingStateWithPostponed(int boundedCapacity) : base(boundedCapacity) /// Stated used only when bounding and when postponed messages and a task are stored. /// Specifies the type of input messages. - internal class BoundingStateWithPostponedAndTask : BoundingStateWithPostponed + internal sealed class BoundingStateWithPostponedAndTask : BoundingStateWithPostponed { /// The task used to process messages. internal Task? TaskForInputProcessing; diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelLoopState.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelLoopState.cs index 85f88ba1c40eb..71a1c31457f5c 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelLoopState.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelLoopState.cs @@ -262,7 +262,7 @@ internal static void Break(long iteration, ParallelLoopStateFlags64 pflags) } } - internal class ParallelLoopState32 : ParallelLoopState + internal sealed class ParallelLoopState32 : ParallelLoopState { private readonly ParallelLoopStateFlags32 _sharedParallelStateFlags; private int _currentIteration; @@ -326,7 +326,7 @@ internal override void InternalBreak() /// /// Allows independent iterations of a parallel loop to interact with other iterations. /// - internal class ParallelLoopState64 : ParallelLoopState + internal sealed class ParallelLoopState64 : ParallelLoopState { private readonly ParallelLoopStateFlags64 _sharedParallelStateFlags; private long _currentIteration; @@ -459,7 +459,7 @@ internal bool Cancel() /// An internal class used to share accounting information in 32-bit versions /// of For()/ForEach() loops. /// - internal class ParallelLoopStateFlags32 : ParallelLoopStateFlags + internal sealed class ParallelLoopStateFlags32 : ParallelLoopStateFlags { // Records the lowest iteration at which a Break() has been called, // or Int32.MaxValue if no break has been called. Used directly @@ -525,7 +525,7 @@ internal bool ShouldExitLoop() /// An internal class used to share accounting information in 64-bit versions /// of For()/ForEach() loops. /// - internal class ParallelLoopStateFlags64 : ParallelLoopStateFlags + internal sealed class ParallelLoopStateFlags64 : ParallelLoopStateFlags { // Records the lowest iteration at which a Break() has been called, // or Int64.MaxValue if no break has been called. Used directly diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelRangeManager.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelRangeManager.cs index 386ac5132b382..0112b3b25b053 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelRangeManager.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/ParallelRangeManager.cs @@ -204,7 +204,7 @@ internal bool FindNewWork32(out int nFromInclusiveLocal32, out int nToExclusiveL /// 2) Every thread joining to service the parallel loop calls RegisterWorker to grab a /// RangeWorker struct to wrap the state it will need to find and execute work, /// and they keep interacting with that struct until the end of the loop - internal class RangeManager + internal sealed class RangeManager { internal readonly IndexRange[] _indexRanges; internal readonly bool _use32BitCurrentIndex; diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs index e7ee33ae0434a..c10e9c8b19b1c 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs @@ -13,7 +13,7 @@ namespace System.Threading.Tasks // the scheduler, and if it starts running we queue another one, etc., up to some (potentially) user-defined // limit. // - internal class TaskReplicator + internal sealed class TaskReplicator { public delegate void ReplicatableUserAction(ref TState replicaState, int timeout, out bool yieldedBeforeCompletion); diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/DistributedTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/DistributedTransaction.cs index 90947797d2ba9..fecc85d70f984 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/DistributedTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/DistributedTransaction.cs @@ -146,13 +146,13 @@ internal static Exception NotSupported() return new PlatformNotSupportedException(SR.DistributedNotSupported); } - internal class RealDistributedTransaction + internal sealed class RealDistributedTransaction { internal InternalTransaction? InternalTransaction { get; set; } } } - internal class DistributedDependentTransaction : DistributedTransaction + internal sealed class DistributedDependentTransaction : DistributedTransaction { internal void Complete() { @@ -160,7 +160,7 @@ internal void Complete() } } - internal class DistributedCommittableTransaction : DistributedTransaction + internal sealed class DistributedCommittableTransaction : DistributedTransaction { internal void BeginCommit(InternalTransaction tx) { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/DurableEnlistmentState.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/DurableEnlistmentState.cs index 523a922427558..b9e08e75a534f 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/DurableEnlistmentState.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/DurableEnlistmentState.cs @@ -36,7 +36,7 @@ internal abstract class DurableEnlistmentState : EnlistmentState // Active state for a durable enlistment. In this state the transaction can be aborted // asynchronously by calling abort. - internal class DurableEnlistmentActive : DurableEnlistmentState + internal sealed class DurableEnlistmentActive : DurableEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -83,7 +83,7 @@ internal override void ChangeStateDelegated(InternalEnlistment enlistment) // Aborting state for a durable enlistment. In this state the transaction has been aborted, // by someone other than the enlistment. // - internal class DurableEnlistmentAborting : DurableEnlistmentState + internal sealed class DurableEnlistmentAborting : DurableEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -136,7 +136,7 @@ internal override void EnlistmentDone(InternalEnlistment enlistment) // Committing state is when SPC has been sent to an enlistment but no response // has been received. // - internal class DurableEnlistmentCommitting : DurableEnlistmentState + internal sealed class DurableEnlistmentCommitting : DurableEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -226,7 +226,7 @@ internal override void InDoubt(InternalEnlistment enlistment, Exception? e) // Delegated state for a durable enlistment represents an enlistment that was // origionally a PromotableSinglePhaseEnlisment that where promotion has happened. // These enlistments don't need to participate in the commit process anymore. - internal class DurableEnlistmentDelegated : DurableEnlistmentState + internal sealed class DurableEnlistmentDelegated : DurableEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -284,7 +284,7 @@ internal override void InDoubt(InternalEnlistment enlistment, Exception? e) // Ended state is the state that is entered when the durable enlistment has committed, // aborted, or said read only for an enlistment. At this point there are no valid // operations on the enlistment. - internal class DurableEnlistmentEnded : DurableEnlistmentState + internal sealed class DurableEnlistmentEnded : DurableEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/Enlistment.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/Enlistment.cs index 1762eee0a6a72..ffbf6d12ef8de 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/Enlistment.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/Enlistment.cs @@ -355,7 +355,7 @@ protected DurableInternalEnlistment(Enlistment enlistment, IEnlistmentNotificati // Since RecoveringInternalEnlistment does not have a transaction it must take // a separate object as its sync root. // - internal class RecoveringInternalEnlistment : DurableInternalEnlistment + internal sealed class RecoveringInternalEnlistment : DurableInternalEnlistment { private readonly object _syncRoot; @@ -368,7 +368,7 @@ internal RecoveringInternalEnlistment(Enlistment enlistment, IEnlistmentNotifica internal override object SyncRoot => _syncRoot; } - internal class PromotableInternalEnlistment : InternalEnlistment + internal sealed class PromotableInternalEnlistment : InternalEnlistment { // This class acts as the durable single phase enlistment for a // promotable single phase enlistment. @@ -390,7 +390,7 @@ internal PromotableInternalEnlistment( // This class supports volatile enlistments // - internal class Phase1VolatileEnlistment : InternalEnlistment + internal sealed class Phase1VolatileEnlistment : InternalEnlistment { public Phase1VolatileEnlistment( Enlistment enlistment, diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/EnlistmentState.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/EnlistmentState.cs index 908ef2cf32441..70f3343470993 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/EnlistmentState.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/EnlistmentState.cs @@ -103,7 +103,7 @@ internal virtual void ChangeStateSinglePhaseCommit(InternalEnlistment enlistment } } - internal class EnlistmentStatePromoted : EnlistmentState + internal sealed class EnlistmentStatePromoted : EnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/InternalTransaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/InternalTransaction.cs index d582c63a1e5be..b16ec9e1a1772 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/InternalTransaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/InternalTransaction.cs @@ -12,11 +12,11 @@ namespace System.Transactions // InternalTransaction // // This class holds the state and all data common to a transaction instance - internal class InternalTransaction : IDisposable + internal sealed class InternalTransaction : IDisposable { // This variable manages the state of the transaction it should be one of the // static elements of TransactionState derived from TransactionState. - protected TransactionState? _transactionState; + private TransactionState? _transactionState; internal TransactionState? State { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs index 136e664ab929c..e6594884552a9 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/Transaction.cs @@ -1222,11 +1222,11 @@ public static bool TryGetCurrentData([NotNullWhen(true)] out ContextData? curren // // MarshalByRefObject is needed for cross AppDomain scenarios where just using object will end up with a different reference when call is made across serialization boundary. // - internal class ContextKey // : MarshalByRefObject + internal sealed class ContextKey // : MarshalByRefObject { } - internal class ContextData + internal sealed class ContextData { internal TransactionScope? CurrentScope; internal Transaction? CurrentTransaction; diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs index 3157fe62a86e0..f0f1bcb100881 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionState.cs @@ -827,7 +827,7 @@ internal override void DisposeRoot(InternalTransaction tx) // TransactionStateSubordinateActive // // This is a transaction that is a very basic subordinate to some external TM. - internal class TransactionStateSubordinateActive : TransactionStateActive + internal sealed class TransactionStateSubordinateActive : TransactionStateActive { // Every state must override EnterState internal override void EnterState(InternalTransaction tx) @@ -916,7 +916,7 @@ internal override void CreateAbortingClone(InternalTransaction tx) // TransactionStatePhase0 // // A transaction that is in the beginning stage of committing. - internal class TransactionStatePhase0 : EnlistableStates + internal sealed class TransactionStatePhase0 : EnlistableStates { internal override void EnterState(InternalTransaction tx) { @@ -1182,7 +1182,7 @@ internal override void GetObjectData(InternalTransaction tx, SerializationInfo s // TransactionStateVolatilePhase1 // // Represents the transaction state during phase 1 preparing volatile enlistments - internal class TransactionStateVolatilePhase1 : ActiveStates + internal sealed class TransactionStateVolatilePhase1 : ActiveStates { internal override void EnterState(InternalTransaction tx) { @@ -1268,7 +1268,7 @@ internal override void Timeout(InternalTransaction tx) // TransactionStateVolatileSPC // // Represents the transaction state during phase 1 when issuing SPC to a volatile enlistment - internal class TransactionStateVolatileSPC : ActiveStates + internal sealed class TransactionStateVolatileSPC : ActiveStates { internal override void EnterState(InternalTransaction tx) { @@ -1309,7 +1309,7 @@ internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exc // TransactionStateSPC // // Represents the transaction state during phase 1 - internal class TransactionStateSPC : ActiveStates + internal sealed class TransactionStateSPC : ActiveStates { internal override void EnterState(InternalTransaction tx) { @@ -1388,7 +1388,7 @@ internal override bool IsCompleted(InternalTransaction tx) // // The transaction has been aborted. Abort is itempotent and can be called again but any // other operations on the transaction should fail. - internal class TransactionStateAborted : TransactionStateEnded + internal sealed class TransactionStateAborted : TransactionStateEnded { internal override void EnterState(InternalTransaction tx) { @@ -1526,7 +1526,7 @@ private TransactionException CreateTransactionAbortedException(InternalTransacti // // This state indicates that the transaction has been committed. Basically any // operations on the transaction should fail at this point. - internal class TransactionStateCommitted : TransactionStateEnded + internal sealed class TransactionStateCommitted : TransactionStateEnded { internal override void EnterState(InternalTransaction tx) { @@ -1589,7 +1589,7 @@ internal override void EndCommit(InternalTransaction tx) // TransactionStateInDoubt // // This state indicates that the transaction is in doubt - internal class TransactionStateInDoubt : TransactionStateEnded + internal sealed class TransactionStateInDoubt : TransactionStateEnded { internal override void EnterState(InternalTransaction tx) { @@ -2151,7 +2151,7 @@ internal override void Phase1VolatilePrepareDone(InternalTransaction tx) // // This state indicates that the transaction has been promoted and all further actions on // the transaction should be forwarded to the promoted transaction. - internal class TransactionStateNonCommittablePromoted : TransactionStatePromotedBase + internal sealed class TransactionStateNonCommittablePromoted : TransactionStatePromotedBase { internal override void EnterState(InternalTransaction tx) { @@ -2528,7 +2528,7 @@ internal override void ChangeStatePromotedPhase1(InternalTransaction tx) // This state indicates that the transaction has been promoted and started the process // of committing. The transaction had volatile phase0 enlistments and is acting as a // proxy to the TM for those phase0 enlistments. - internal class TransactionStatePromotedPhase0 : TransactionStatePromotedCommitting + internal sealed class TransactionStatePromotedPhase0 : TransactionStatePromotedCommitting { internal override void EnterState(InternalTransaction tx) { @@ -2610,7 +2610,7 @@ internal override void ChangeStateTransactionAborted(InternalTransaction tx, Exc // This state indicates that the transaction has been promoted and started the process // of committing. The transaction had volatile phase1 enlistments and is acting as a // proxy to the TM for those phase1 enlistments. - internal class TransactionStatePromotedPhase1 : TransactionStatePromotedCommitting + internal sealed class TransactionStatePromotedPhase1 : TransactionStatePromotedCommitting { internal override void EnterState(InternalTransaction tx) { @@ -2791,7 +2791,7 @@ internal override void RestartCommitIfNeeded(InternalTransaction tx) // // This state indicates that the transaction has been promoted but aborted by a phase 0 volatile // enlistment. Once the volatile enlistments have finished responding the tx can be finished. - internal class TransactionStatePromotedP0Aborting : TransactionStatePromotedAborting + internal sealed class TransactionStatePromotedP0Aborting : TransactionStatePromotedAborting { internal override void EnterState(InternalTransaction tx) { @@ -2834,7 +2834,7 @@ internal override void Phase0VolatilePrepareDone(InternalTransaction tx) // // This state indicates that the transaction has been promoted but aborted by a phase 1 volatile // enlistment. Once the volatile enlistments have finished responding the tx can be finished. - internal class TransactionStatePromotedP1Aborting : TransactionStatePromotedAborting + internal sealed class TransactionStatePromotedP1Aborting : TransactionStatePromotedAborting { internal override void EnterState(InternalTransaction tx) { @@ -3108,7 +3108,7 @@ internal override void InDoubtFromEnlistment(InternalTransaction tx) // // This state indicates that the transaction has been promoted and the outcome // of the transaction is committed - internal class TransactionStatePromotedCommitted : TransactionStatePromotedEnded + internal sealed class TransactionStatePromotedCommitted : TransactionStatePromotedEnded { internal override void EnterState(InternalTransaction tx) { @@ -3178,7 +3178,7 @@ internal override void InDoubtFromEnlistment(InternalTransaction tx) // // This state indicates that the transaction has been promoted but the outcome // of the transaction is indoubt. - internal class TransactionStatePromotedIndoubt : TransactionStatePromotedEnded + internal sealed class TransactionStatePromotedIndoubt : TransactionStatePromotedEnded { internal override void EnterState(InternalTransaction tx) { @@ -3387,7 +3387,7 @@ internal override void EnterState(InternalTransaction tx) // This state represents a transaction that had a promotable single phase enlistment that then // was promoted. Most of the functionality is inherited from transaction state promoted // except for the way that commit happens. - internal class TransactionStateDelegated : TransactionStateDelegatedBase + internal sealed class TransactionStateDelegated : TransactionStateDelegatedBase { internal override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback? asyncCallback, object? asyncState) { @@ -3694,7 +3694,7 @@ internal override void DisposeRoot(InternalTransaction tx) // TransactionStatePromotedNonMSDTCPhase0 // // A transaction that is in the beginning stage of committing. - internal class TransactionStatePromotedNonMSDTCPhase0 : TransactionStatePromotedNonMSDTCBase + internal sealed class TransactionStatePromotedNonMSDTCPhase0 : TransactionStatePromotedNonMSDTCBase { internal override void EnterState(InternalTransaction tx) { @@ -3787,7 +3787,7 @@ internal override bool ContinuePhase0Prepares() // TransactionStatePromotedNonMSDTCVolatilePhase1 // // Represents the transaction state during phase 1 preparing volatile enlistments - internal class TransactionStatePromotedNonMSDTCVolatilePhase1 : TransactionStatePromotedNonMSDTCBase + internal sealed class TransactionStatePromotedNonMSDTCVolatilePhase1 : TransactionStatePromotedNonMSDTCBase { internal override void EnterState(InternalTransaction tx) { @@ -3889,7 +3889,7 @@ internal override void CreateAbortingClone(InternalTransaction tx) // TransactionStatePromotedNonMSDTCSinglePhaseCommit // // The transaction has been delegated to a NON-MSDTC promoter and is in the process of committing. - internal class TransactionStatePromotedNonMSDTCSinglePhaseCommit : TransactionStatePromotedNonMSDTCBase + internal sealed class TransactionStatePromotedNonMSDTCSinglePhaseCommit : TransactionStatePromotedNonMSDTCBase { internal override void EnterState(InternalTransaction tx) { @@ -4077,7 +4077,7 @@ private static void SignalCallback(object state) // // This state indicates that the transaction has been promoted to a non-MSDTC promoter and the outcome // of the transaction is aborted. - internal class TransactionStatePromotedNonMSDTCAborted : TransactionStatePromotedNonMSDTCEnded + internal sealed class TransactionStatePromotedNonMSDTCAborted : TransactionStatePromotedNonMSDTCEnded { internal override void EnterState(InternalTransaction tx) { @@ -4175,7 +4175,7 @@ internal override void GetObjectData(InternalTransaction tx, SerializationInfo s // // This state indicates that the transaction has been non-MSDTC promoted and the outcome // of the transaction is committed - internal class TransactionStatePromotedNonMSDTCCommitted : TransactionStatePromotedNonMSDTCEnded + internal sealed class TransactionStatePromotedNonMSDTCCommitted : TransactionStatePromotedNonMSDTCEnded { internal override void EnterState(InternalTransaction tx) { @@ -4219,7 +4219,7 @@ protected override void PromotedTransactionOutcome(InternalTransaction tx) // // This state indicates that the transaction has been non-MSDTC promoted but the outcome // of the transaction is indoubt. - internal class TransactionStatePromotedNonMSDTCIndoubt : TransactionStatePromotedNonMSDTCEnded + internal sealed class TransactionStatePromotedNonMSDTCIndoubt : TransactionStatePromotedNonMSDTCEnded { internal override void EnterState(InternalTransaction tx) { @@ -4296,7 +4296,7 @@ internal override void CreateAbortingClone(InternalTransaction tx) // TransactionStateDelegatedNonMSDTC // // This state is the base state for delegated transactions to non-MSDTC promoters. - internal class TransactionStateDelegatedNonMSDTC : TransactionStatePromotedNonMSDTCBase + internal sealed class TransactionStateDelegatedNonMSDTC : TransactionStatePromotedNonMSDTCBase { internal override void EnterState(InternalTransaction tx) { @@ -4346,7 +4346,7 @@ internal override void EnterState(InternalTransaction tx) // // This state represents a transaction that is subordinate to another TM and has been // promoted. - internal class TransactionStateDelegatedSubordinate : TransactionStateDelegatedBase + internal sealed class TransactionStateDelegatedSubordinate : TransactionStateDelegatedBase { internal override bool PromoteDurable(InternalTransaction tx) { @@ -4387,7 +4387,7 @@ internal override void ChangeStatePromotedPhase1(InternalTransaction tx) // // Someone is trying to enlist for promotable single phase. // Don't allow anything that is not supported. - internal class TransactionStatePSPEOperation : TransactionState + internal sealed class TransactionStatePSPEOperation : TransactionState { internal override void EnterState(InternalTransaction tx) { @@ -4653,7 +4653,7 @@ internal override void SetDistributedTransactionId(InternalTransaction tx, // This state is exactly the same as TransactionStatePromotedP0Wave with // the exception that when commit is restarted it is restarted in a different // way. - internal class TransactionStateDelegatedP0Wave : TransactionStatePromotedP0Wave + internal sealed class TransactionStateDelegatedP0Wave : TransactionStatePromotedP0Wave { internal override void Phase0VolatilePrepareDone(InternalTransaction tx) { @@ -4665,7 +4665,7 @@ internal override void Phase0VolatilePrepareDone(InternalTransaction tx) // TransactionStateDelegatedCommitting // // The transaction has been promoted but is in the process of committing. - internal class TransactionStateDelegatedCommitting : TransactionStatePromotedCommitting + internal sealed class TransactionStateDelegatedCommitting : TransactionStatePromotedCommitting { internal override void EnterState(InternalTransaction tx) { @@ -4697,7 +4697,7 @@ internal override void EnterState(InternalTransaction tx) // TransactionStateDelegatedAborting // // The transaction has been promoted but is in the process of committing. - internal class TransactionStateDelegatedAborting : TransactionStatePromotedAborted + internal sealed class TransactionStateDelegatedAborting : TransactionStatePromotedAborted { internal override void EnterState(InternalTransaction tx) { diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs index 2603192921453..c256c0530bc61 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs @@ -6,7 +6,7 @@ namespace System.Transactions { - internal class CheapUnfairReaderWriterLock + internal sealed class CheapUnfairReaderWriterLock { private object? _writerFinishedEvent; @@ -120,7 +120,7 @@ public void ExitWriteLock() // This transaction table implementation uses an array of lists to avoid contention. The list for a // transaction is decided by its hashcode. - internal class TransactionTable + internal sealed class TransactionTable { // Use a timer to initiate looking for transactions that have timed out. private readonly Timer _timer; @@ -537,7 +537,7 @@ private void ThreadTimer(object? state) } - internal class BucketSet + internal sealed class BucketSet { // Buckets are kept in sets. Each element of a set will have the same absoluteTimeout. internal object? nextSetWeak; @@ -595,7 +595,7 @@ internal void TimeoutTransactions() } - internal class Bucket + internal sealed class Bucket { private bool _timedOut; private int _index; diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentMultiplexing.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentMultiplexing.cs index 2b42ce324dc30..5394b20677155 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentMultiplexing.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentMultiplexing.cs @@ -249,7 +249,7 @@ protected static void PoolableInDoubt(object state) // This class implements the phase 0 version of a volatile demux. - internal class Phase0VolatileDemultiplexer : VolatileDemultiplexer + internal sealed class Phase0VolatileDemultiplexer : VolatileDemultiplexer { public Phase0VolatileDemultiplexer(InternalTransaction transaction) : base(transaction) { } @@ -340,7 +340,7 @@ public override void InDoubt(IPromotedEnlistment en) } // This class implements the phase 1 version of a volatile demux. - internal class Phase1VolatileDemultiplexer : VolatileDemultiplexer + internal sealed class Phase1VolatileDemultiplexer : VolatileDemultiplexer { public Phase1VolatileDemultiplexer(InternalTransaction transaction) : base(transaction) { } diff --git a/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentState.cs b/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentState.cs index f6c92bc4dd33d..7873186e9c29e 100644 --- a/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentState.cs +++ b/src/libraries/System.Transactions.Local/src/System/Transactions/VolatileEnlistmentState.cs @@ -77,7 +77,7 @@ internal override byte[] RecoveryInformation(InternalEnlistment enlistment) // but no one has begun committing or aborting the transaction. From this state the enlistment // can abort the transaction or call read only to indicate that it does not want to // participate further in the transaction. - internal class VolatileEnlistmentActive : VolatileEnlistmentState + internal sealed class VolatileEnlistmentActive : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -128,7 +128,7 @@ internal override void InternalAborted(InternalEnlistment enlistment) } // Preparing state is the time after prepare has been called but no response has been received. - internal class VolatileEnlistmentPreparing : VolatileEnlistmentState + internal sealed class VolatileEnlistmentPreparing : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -201,7 +201,7 @@ internal override void InternalAborted(InternalEnlistment enlistment) // SPC state for a volatile enlistment is the point at which there is exactly 1 enlisment // and it supports SPC. The TM will send a single phase commit to the enlistment and wait // for the response from the TM. - internal class VolatileEnlistmentSPC : VolatileEnlistmentState + internal sealed class VolatileEnlistmentSPC : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -274,7 +274,7 @@ internal override void InDoubt(InternalEnlistment enlistment, Exception? e) // Prepared state for a volatile enlistment is the point at which prepare has been called // and the enlistment has responded prepared. No enlistment operations are valid at this // point. The RM must wait for the TM to take the next action. - internal class VolatileEnlistmentPrepared : VolatileEnlistmentState + internal sealed class VolatileEnlistmentPrepared : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -307,7 +307,7 @@ internal override void ChangeStatePreparing(InternalEnlistment enlistment) } // Aborting state is when Rollback has been sent to the enlistment. - internal class VolatileEnlistmentPreparingAborting : VolatileEnlistmentState + internal sealed class VolatileEnlistmentPreparingAborting : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -356,7 +356,7 @@ internal override void InternalAborted(InternalEnlistment enlistment) } // Aborting state is when Rollback has been sent to the enlistment. - internal class VolatileEnlistmentAborting : VolatileEnlistmentState + internal sealed class VolatileEnlistmentAborting : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -399,7 +399,7 @@ internal override void InternalAborted(InternalEnlistment enlistment) } // Committing state is when Commit has been sent to the enlistment. - internal class VolatileEnlistmentCommitting : VolatileEnlistmentState + internal sealed class VolatileEnlistmentCommitting : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -433,7 +433,7 @@ internal override void EnlistmentDone(InternalEnlistment enlistment) } // InDoubt state is for an enlistment that has sent indoubt but has not been responeded to. - internal class VolatileEnlistmentInDoubt : VolatileEnlistmentState + internal sealed class VolatileEnlistmentInDoubt : VolatileEnlistmentState { internal override void EnterState(InternalEnlistment enlistment) { @@ -510,7 +510,7 @@ internal override void InDoubt(InternalEnlistment enlistment, Exception? e) } // At some point either early or late the enlistment responded ReadOnly - internal class VolatileEnlistmentDone : VolatileEnlistmentEnded + internal sealed class VolatileEnlistmentDone : VolatileEnlistmentEnded { internal override void EnterState(InternalEnlistment enlistment) { diff --git a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/SafeX509Handles.cs b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/SafeX509Handles.cs index 40ff613f9f94e..613a91fd6fbf4 100644 --- a/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/SafeX509Handles.cs +++ b/src/libraries/System.Windows.Extensions/src/System/Security/Cryptography/X509Certificates/SafeX509Handles.cs @@ -6,7 +6,7 @@ namespace System.Security.Cryptography.X509Certificates { - internal class SafeCertContextHandle : SafePointerHandle + internal sealed class SafeCertContextHandle : SafePointerHandle { protected override bool ReleaseHandle() {