diff --git a/src/Castle.Core/DynamicProxy/Contributors/ClassProxyTargetContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/ClassProxyTargetContributor.cs index 38f03d52a0..e52c7248a3 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/ClassProxyTargetContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/ClassProxyTargetContributor.cs @@ -27,7 +27,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Tokens; - internal class ClassProxyTargetContributor : CompositeTypeContributor + internal sealed class ClassProxyTargetContributor : CompositeTypeContributor { private readonly IList methodsToSkip; private readonly Type targetType; diff --git a/src/Castle.Core/DynamicProxy/Contributors/ClassProxyWithTargetTargetContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/ClassProxyWithTargetTargetContributor.cs index 911f0fc571..9efa050c79 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/ClassProxyWithTargetTargetContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/ClassProxyWithTargetTargetContributor.cs @@ -25,7 +25,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Tokens; - internal class ClassProxyWithTargetTargetContributor : CompositeTypeContributor + internal sealed class ClassProxyWithTargetTargetContributor : CompositeTypeContributor { private readonly IList methodsToSkip; private readonly Type targetType; diff --git a/src/Castle.Core/DynamicProxy/Contributors/FieldReferenceComparer.cs b/src/Castle.Core/DynamicProxy/Contributors/FieldReferenceComparer.cs index 1a658b46f8..7393786617 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/FieldReferenceComparer.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/FieldReferenceComparer.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Contributors using System; using System.Collections.Generic; - internal class FieldReferenceComparer : IComparer + internal sealed class FieldReferenceComparer : IComparer { public int Compare(Type x, Type y) { diff --git a/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersCollector.cs b/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersCollector.cs index bb0fdc81de..bd54a56989 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersCollector.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersCollector.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators; - internal class InterfaceMembersCollector : MembersCollector + internal sealed class InterfaceMembersCollector : MembersCollector { public InterfaceMembersCollector(Type @interface) : base(@interface) diff --git a/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersOnClassCollector.cs b/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersOnClassCollector.cs index 3e643cf802..8d0bef04cc 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersOnClassCollector.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InterfaceMembersOnClassCollector.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators; - internal class InterfaceMembersOnClassCollector : MembersCollector + internal sealed class InterfaceMembersOnClassCollector : MembersCollector { private readonly InterfaceMapping map; private readonly bool onlyProxyVirtual; diff --git a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyInstanceContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyInstanceContributor.cs index e00e143fa6..1f70715172 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyInstanceContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyInstanceContributor.cs @@ -21,7 +21,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Tokens; - internal class InterfaceProxyInstanceContributor : ProxyInstanceContributor + internal sealed class InterfaceProxyInstanceContributor : ProxyInstanceContributor { protected override Reference GetTargetReference(ClassEmitter emitter) { diff --git a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithOptionalTargetContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithOptionalTargetContributor.cs index 858a6fb205..02aba6425e 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithOptionalTargetContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithOptionalTargetContributor.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators; using Castle.DynamicProxy.Generators.Emitters; - internal class InterfaceProxyWithOptionalTargetContributor : InterfaceProxyWithoutTargetContributor + internal sealed class InterfaceProxyWithOptionalTargetContributor : InterfaceProxyWithoutTargetContributor { private readonly GetTargetReferenceDelegate getTargetReference; diff --git a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithTargetInterfaceTargetContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithTargetInterfaceTargetContributor.cs index b1f4525965..4e97787c2e 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithTargetInterfaceTargetContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InterfaceProxyWithTargetInterfaceTargetContributor.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators; - internal class InterfaceProxyWithTargetInterfaceTargetContributor : InterfaceProxyTargetContributor + internal sealed class InterfaceProxyWithTargetInterfaceTargetContributor : InterfaceProxyTargetContributor { public InterfaceProxyWithTargetInterfaceTargetContributor(Type proxyTargetType, bool allowChangeTarget, INamingScope namingScope) diff --git a/src/Castle.Core/DynamicProxy/Contributors/InvocationWithDelegateContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/InvocationWithDelegateContributor.cs index f540762bf7..f05dd96203 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InvocationWithDelegateContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InvocationWithDelegateContributor.cs @@ -23,7 +23,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Tokens; - internal class InvocationWithDelegateContributor : IInvocationCreationContributor + internal sealed class InvocationWithDelegateContributor : IInvocationCreationContributor { private readonly Type delegateType; private readonly MetaMethod method; diff --git a/src/Castle.Core/DynamicProxy/Contributors/InvocationWithGenericDelegateContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/InvocationWithGenericDelegateContributor.cs index 0bd8c97951..b4a87e1c59 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/InvocationWithGenericDelegateContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/InvocationWithGenericDelegateContributor.cs @@ -25,7 +25,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Tokens; - internal class InvocationWithGenericDelegateContributor : IInvocationCreationContributor + internal sealed class InvocationWithGenericDelegateContributor : IInvocationCreationContributor { private readonly Type delegateType; private readonly MetaMethod method; diff --git a/src/Castle.Core/DynamicProxy/Contributors/MixinContributor.cs b/src/Castle.Core/DynamicProxy/Contributors/MixinContributor.cs index 1f91ac7802..c7a1f8a0dd 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/MixinContributor.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/MixinContributor.cs @@ -24,7 +24,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Internal; - internal class MixinContributor : CompositeTypeContributor + internal sealed class MixinContributor : CompositeTypeContributor { private readonly bool canChangeTarget; private readonly IList empty = new List(); diff --git a/src/Castle.Core/DynamicProxy/Contributors/WrappedClassMembersCollector.cs b/src/Castle.Core/DynamicProxy/Contributors/WrappedClassMembersCollector.cs index 584f896b25..ed50401432 100644 --- a/src/Castle.Core/DynamicProxy/Contributors/WrappedClassMembersCollector.cs +++ b/src/Castle.Core/DynamicProxy/Contributors/WrappedClassMembersCollector.cs @@ -22,7 +22,7 @@ namespace Castle.DynamicProxy.Contributors using Castle.DynamicProxy.Generators.Emitters; using Castle.DynamicProxy.Internal; - internal class WrappedClassMembersCollector : ClassMembersCollector + internal sealed class WrappedClassMembersCollector : ClassMembersCollector { public WrappedClassMembersCollector(Type type) : base(type) { @@ -52,13 +52,13 @@ protected override MetaMethod GetMethodToGenerate(MethodInfo method, IProxyGener return new MetaMethod(method, method, isStandalone, accepted, hasTarget: true); } - protected bool IsGeneratedByTheCompiler(FieldInfo field) + private bool IsGeneratedByTheCompiler(FieldInfo field) { // for example fields backing autoproperties return field.IsDefined(typeof(CompilerGeneratedAttribute)); } - protected virtual bool IsOKToBeOnProxy(FieldInfo field) + private bool IsOKToBeOnProxy(FieldInfo field) { return IsGeneratedByTheCompiler(field); } diff --git a/src/Castle.Core/DynamicProxy/Generators/CacheKey.cs b/src/Castle.Core/DynamicProxy/Generators/CacheKey.cs index d0a98b8f62..13df32e3cb 100644 --- a/src/Castle.Core/DynamicProxy/Generators/CacheKey.cs +++ b/src/Castle.Core/DynamicProxy/Generators/CacheKey.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators #if FEATURE_SERIALIZATION [Serializable] #endif - internal class CacheKey + internal sealed class CacheKey { private readonly MemberInfo target; private readonly Type[] interfaces; diff --git a/src/Castle.Core/DynamicProxy/Generators/ClassProxyGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/ClassProxyGenerator.cs index 1dd9f9d286..845e058fcc 100644 --- a/src/Castle.Core/DynamicProxy/Generators/ClassProxyGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/ClassProxyGenerator.cs @@ -25,7 +25,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Serialization; - internal class ClassProxyGenerator : BaseProxyGenerator + internal sealed class ClassProxyGenerator : BaseProxyGenerator { public ClassProxyGenerator(ModuleScope scope, Type targetType, Type[] interfaces, ProxyGenerationOptions options) : base(scope, targetType, interfaces, options) @@ -94,8 +94,7 @@ protected override Type GenerateType(string name, INamingScope namingScope) return proxyType; } - protected virtual IEnumerable GetTypeImplementerMapping(out IEnumerable contributors, - INamingScope namingScope) + private IEnumerable GetTypeImplementerMapping(out IEnumerable contributors, INamingScope namingScope) { var methodsToSkip = new List(); var proxyInstance = new ClassProxyInstanceContributor(targetType, methodsToSkip, interfaces, ProxyTypeConstants.Class); diff --git a/src/Castle.Core/DynamicProxy/Generators/ClassProxyWithTargetGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/ClassProxyWithTargetGenerator.cs index fa5f51baf7..9cfbbf8c03 100644 --- a/src/Castle.Core/DynamicProxy/Generators/ClassProxyWithTargetGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/ClassProxyWithTargetGenerator.cs @@ -28,7 +28,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Serialization; - internal class ClassProxyWithTargetGenerator : BaseProxyGenerator + internal sealed class ClassProxyWithTargetGenerator : BaseProxyGenerator { public ClassProxyWithTargetGenerator(ModuleScope scope, Type targetType, Type[] interfaces, ProxyGenerationOptions options) @@ -37,8 +37,7 @@ public ClassProxyWithTargetGenerator(ModuleScope scope, Type targetType, Type[] EnsureDoesNotImplementIProxyTargetAccessor(targetType, "targetType"); } - protected virtual IEnumerable GetTypeImplementerMapping(out IEnumerable contributors, - INamingScope namingScope) + private IEnumerable GetTypeImplementerMapping(out IEnumerable contributors, INamingScope namingScope) { var methodsToSkip = new List(); var proxyInstance = new ClassProxyWithTargetInstanceContributor(targetType, methodsToSkip, interfaces, diff --git a/src/Castle.Core/DynamicProxy/Generators/CompositionInvocationTypeGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/CompositionInvocationTypeGenerator.cs index a1b6959e2f..c244ff60b0 100644 --- a/src/Castle.Core/DynamicProxy/Generators/CompositionInvocationTypeGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/CompositionInvocationTypeGenerator.cs @@ -23,7 +23,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Tokens; - internal class CompositionInvocationTypeGenerator : InvocationTypeGenerator + internal sealed class CompositionInvocationTypeGenerator : InvocationTypeGenerator { public static readonly Type BaseType = typeof(CompositionInvocation); diff --git a/src/Castle.Core/DynamicProxy/Generators/DelegateTypeGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/DelegateTypeGenerator.cs index 11db73f2ac..e4ebf128cd 100644 --- a/src/Castle.Core/DynamicProxy/Generators/DelegateTypeGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/DelegateTypeGenerator.cs @@ -21,7 +21,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters.SimpleAST; using Castle.DynamicProxy.Internal; - internal class DelegateTypeGenerator : IGenerator + internal sealed class DelegateTypeGenerator : IGenerator { private const TypeAttributes DelegateFlags = TypeAttributes.Class | TypeAttributes.Public | diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/ArgumentsUtil.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/ArgumentsUtil.cs index 1c0cbf7c38..66538112e9 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/ArgumentsUtil.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/ArgumentsUtil.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal abstract class ArgumentsUtil + internal static class ArgumentsUtil { public static Expression[] ConvertArgumentReferenceToExpression(ArgumentReference[] args) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/ClassEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/ClassEmitter.cs index 4a428c8880..cf1caf6dac 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/ClassEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/ClassEmitter.cs @@ -22,7 +22,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using Castle.DynamicProxy.Internal; - internal class ClassEmitter : AbstractTypeEmitter + internal sealed class ClassEmitter : AbstractTypeEmitter { internal const TypeAttributes DefaultAttributes = TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.Serializable; @@ -81,8 +81,7 @@ internal bool InStrongNamedModule get { return StrongNameUtil.IsAssemblySigned(TypeBuilder.Assembly); } } - protected virtual IEnumerable InitializeGenericArgumentsFromBases(ref Type baseType, - IEnumerable interfaces) + private IEnumerable InitializeGenericArgumentsFromBases(ref Type baseType, IEnumerable interfaces) { if (baseType != null && baseType.IsGenericTypeDefinition) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/ConstructorCodeBuilder.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/ConstructorCodeBuilder.cs index 0e4f0a7f81..10c1e4dd4a 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/ConstructorCodeBuilder.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/ConstructorCodeBuilder.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.CodeBuilders using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal class ConstructorCodeBuilder : AbstractCodeBuilder + internal sealed class ConstructorCodeBuilder : AbstractCodeBuilder { private readonly Type baseType; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/MethodCodeBuilder.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/MethodCodeBuilder.cs index 5c0e73adc6..9e4c5bbf71 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/MethodCodeBuilder.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/CodeBuilders/MethodCodeBuilder.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.CodeBuilders { using System.Reflection.Emit; - internal class MethodCodeBuilder : AbstractCodeBuilder + internal sealed class MethodCodeBuilder : AbstractCodeBuilder { public MethodCodeBuilder(ILGenerator generator) : base(generator) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/EventEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/EventEmitter.cs index 25c8dd5e67..75a0e36844 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/EventEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/EventEmitter.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using System.Reflection; using System.Reflection.Emit; - internal class EventEmitter : IMemberEmitter + internal sealed class EventEmitter : IMemberEmitter { private readonly EventBuilder eventBuilder; private readonly Type type; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs index 0447dc7533..0eff2224dc 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/GenericUtil.cs @@ -25,7 +25,7 @@ namespace Castle.DynamicProxy.Generators.Emitters internal delegate GenericTypeParameterBuilder[] ApplyGenArgs(string[] argumentNames); - internal class GenericUtil + internal sealed class GenericUtil { public static GenericTypeParameterBuilder[] CopyGenericArguments( MethodInfo methodToCopyGenericsFrom, diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/MethodEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/MethodEmitter.cs index 0aac5130a3..b14e4972cf 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/MethodEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/MethodEmitter.cs @@ -26,7 +26,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using Castle.DynamicProxy.Internal; [DebuggerDisplay("{builder.Name}")] - internal class MethodEmitter : IMemberEmitter + internal sealed class MethodEmitter : IMemberEmitter { private readonly MethodBuilder builder; private readonly GenericTypeParameterBuilder[] genericTypeParams; @@ -35,7 +35,7 @@ internal class MethodEmitter : IMemberEmitter private MethodCodeBuilder codebuilder; - protected internal MethodEmitter(MethodBuilder builder) + private MethodEmitter(MethodBuilder builder) { this.builder = builder; } @@ -76,7 +76,7 @@ public ArgumentReference[] Arguments get { return arguments; } } - public virtual MethodCodeBuilder CodeBuilder + public MethodCodeBuilder CodeBuilder { get { @@ -129,7 +129,7 @@ public void SetParameters(Type[] paramTypes) ArgumentsUtil.InitializeArgumentsByPosition(arguments, MethodBuilder.IsStatic); } - public virtual void EnsureValidCodeBlock() + public void EnsureValidCodeBlock() { if (ImplementedByRuntime == false && CodeBuilder.IsEmpty) { @@ -138,7 +138,7 @@ public virtual void EnsureValidCodeBlock() } } - public virtual void Generate() + public void Generate() { if (ImplementedByRuntime) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/NestedClassEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/NestedClassEmitter.cs index 53809e46b2..ff161070ff 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/NestedClassEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/NestedClassEmitter.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using System.Reflection; using System.Reflection.Emit; - internal class NestedClassEmitter : AbstractTypeEmitter + internal sealed class NestedClassEmitter : AbstractTypeEmitter { public NestedClassEmitter(AbstractTypeEmitter maintype, string name, Type baseType, Type[] interfaces) : this( diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/OpCodeUtil.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/OpCodeUtil.cs index d95272ca10..566a4af1f7 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/OpCodeUtil.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/OpCodeUtil.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using System.Reflection; using System.Reflection.Emit; - internal abstract class OpCodeUtil + internal static class OpCodeUtil { /// /// Emits a load indirect opcode of the appropriate type for a value or object reference. diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/PropertyEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/PropertyEmitter.cs index c2674b3dea..1034e64e98 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/PropertyEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/PropertyEmitter.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters using System.Reflection; using System.Reflection.Emit; - internal class PropertyEmitter : IMemberEmitter + internal sealed class PropertyEmitter : IMemberEmitter { private readonly PropertyBuilder builder; private readonly AbstractTypeEmitter parentTypeEmitter; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AddressOfReferenceExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AddressOfReferenceExpression.cs index 2e895ba0bc..9c01783fbe 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AddressOfReferenceExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AddressOfReferenceExpression.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class AddressOfReferenceExpression : Expression + internal sealed class AddressOfReferenceExpression : Expression { private readonly Reference reference; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ArgumentReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ArgumentReference.cs index 19be72db47..55aeb84cc0 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ArgumentReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ArgumentReference.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("argument {Type}")] - internal class ArgumentReference : TypeReference + internal sealed class ArgumentReference : TypeReference { public ArgumentReference(Type argumentType) : base(argumentType) diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AsTypeReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AsTypeReference.cs index 6f88889e1f..2869c7ba05 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AsTypeReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AsTypeReference.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("{reference} as {type}")] - internal class AsTypeReference : Reference + internal sealed class AsTypeReference : Reference { private readonly Reference reference; private readonly Type type; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArgumentStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArgumentStatement.cs index b2111858c4..0ed84cc1ea 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArgumentStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArgumentStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class AssignArgumentStatement : Statement + internal sealed class AssignArgumentStatement : Statement { private readonly ArgumentReference argument; private readonly Expression expression; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArrayStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArrayStatement.cs index 013ce729a8..d907176e0c 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArrayStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignArrayStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class AssignArrayStatement : Statement + internal sealed class AssignArrayStatement : Statement { private readonly Reference targetArray; private readonly int targetPosition; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignStatement.cs index 8d28411bca..e40c970dc3 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/AssignStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class AssignStatement : Statement + internal sealed class AssignStatement : Statement { private readonly Expression expression; private readonly Reference target; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/BindDelegateExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/BindDelegateExpression.cs index 640f3528b8..797c8ab525 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/BindDelegateExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/BindDelegateExpression.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using Castle.DynamicProxy.Internal; - internal class BindDelegateExpression : Expression + internal sealed class BindDelegateExpression : Expression { private readonly ConstructorInfo delegateCtor; private readonly MethodInfo methodToBindTo; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ByRefReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ByRefReference.cs index f6fc69ad5b..9bec9d8d4d 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ByRefReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ByRefReference.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST [DebuggerDisplay("&{localReference}")] - internal class ByRefReference : TypeReference + internal sealed class ByRefReference : TypeReference { private readonly LocalReference localReference; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstReference.cs index 4357d0aac1..474bf3cb04 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstReference.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("{value}")] - internal class ConstReference : TypeReference + internal sealed class ConstReference : TypeReference { private readonly object value; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstructorInvocationStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstructorInvocationStatement.cs index 03fb5a49c1..25cd82bcd1 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstructorInvocationStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConstructorInvocationStatement.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class ConstructorInvocationStatement : Statement + internal sealed class ConstructorInvocationStatement : Statement { private readonly Expression[] args; private readonly ConstructorInfo cmethod; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConvertExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConvertExpression.cs index 5fe486759e..3f41f7f713 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConvertExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ConvertExpression.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class ConvertExpression : Expression + internal sealed class ConvertExpression : Expression { private readonly Expression right; private Type fromType; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/DefaultValueExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/DefaultValueExpression.cs index bab0c40f59..ee87f23aa5 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/DefaultValueExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/DefaultValueExpression.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class DefaultValueExpression : Expression + internal sealed class DefaultValueExpression : Expression { private readonly Type type; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/EndExceptionBlockStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/EndExceptionBlockStatement.cs index 85c0c32bc5..d5bbbd7b89 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/EndExceptionBlockStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/EndExceptionBlockStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class EndExceptionBlockStatement : Statement + internal sealed class EndExceptionBlockStatement : Statement { public override void Emit(IMemberEmitter member, ILGenerator gen) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ExpressionStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ExpressionStatement.cs index bc2b50e738..10dd7e1429 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ExpressionStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ExpressionStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class ExpressionStatement : Statement + internal sealed class ExpressionStatement : Statement { private readonly Expression expression; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FieldReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FieldReference.cs index bdc39e68df..08acaa6b48 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FieldReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FieldReference.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("{fieldbuilder.Name} ({fieldbuilder.FieldType})")] - internal class FieldReference : Reference + internal sealed class FieldReference : Reference { private readonly FieldInfo field; private readonly FieldBuilder fieldbuilder; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FinallyStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FinallyStatement.cs index 7311413636..a928062874 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FinallyStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/FinallyStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class FinallyStatement : Statement + internal sealed class FinallyStatement : Statement { public override void Emit(IMemberEmitter member, ILGenerator gen) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IfNullExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IfNullExpression.cs index c7106888bf..cb638ebb1d 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IfNullExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IfNullExpression.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System; using System.Reflection.Emit; - internal class IfNullExpression : Expression + internal sealed class IfNullExpression : Expression { private readonly IILEmitter ifNotNull; private readonly IILEmitter ifNull; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IndirectReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IndirectReference.cs index b1fc40dabd..8301759c7f 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IndirectReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/IndirectReference.cs @@ -24,7 +24,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST /// ByRef and provides indirect load/store support. /// [DebuggerDisplay("&{OwnerReference}")] - internal class IndirectReference : TypeReference + internal sealed class IndirectReference : TypeReference { public IndirectReference(TypeReference byRefReference) : base(byRefReference, byRefReference.Type.GetElementType()) diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LiteralIntExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LiteralIntExpression.cs index 0ab8598227..0e1c9856bc 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LiteralIntExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LiteralIntExpression.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class LiteralIntExpression : Expression + internal sealed class LiteralIntExpression : Expression { private readonly int value; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadArrayElementExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadArrayElementExpression.cs index be90d8dd2d..8c7fc9b633 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadArrayElementExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadArrayElementExpression.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System; using System.Reflection.Emit; - internal class LoadArrayElementExpression : Expression + internal sealed class LoadArrayElementExpression : Expression { private readonly Reference arrayReference; private readonly ConstReference index; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadRefArrayElementExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadRefArrayElementExpression.cs index 94c7ef55ff..25adf38e6a 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadRefArrayElementExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LoadRefArrayElementExpression.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class LoadRefArrayElementExpression : Expression + internal sealed class LoadRefArrayElementExpression : Expression { private readonly Reference arrayReference; private readonly ConstReference index; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LocalReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LocalReference.cs index cc051a52a3..46ad8d5440 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LocalReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/LocalReference.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("local {Type}")] - internal class LocalReference : TypeReference + internal sealed class LocalReference : TypeReference { private LocalBuilder localbuilder; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodInvocationExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodInvocationExpression.cs index 317866e30c..24e73d00ff 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodInvocationExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodInvocationExpression.cs @@ -17,11 +17,11 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class MethodInvocationExpression : Expression + internal sealed class MethodInvocationExpression : Expression { - protected readonly Expression[] args; - protected readonly MethodInfo method; - protected readonly Reference owner; + private readonly Expression[] args; + private readonly MethodInfo method; + private readonly Reference owner; public MethodInvocationExpression(MethodInfo method, params Expression[] args) : this(SelfReference.Self, method, args) diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodTokenExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodTokenExpression.cs index 42150b3ea4..4cf1b42b83 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodTokenExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MethodTokenExpression.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using Castle.DynamicProxy.Tokens; - internal class MethodTokenExpression : Expression + internal sealed class MethodTokenExpression : Expression { private readonly MethodInfo method; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MultiStatementExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MultiStatementExpression.cs index d107e8f529..3072618228 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MultiStatementExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/MultiStatementExpression.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Collections.Generic; using System.Reflection.Emit; - internal class MultiStatementExpression : Expression + internal sealed class MultiStatementExpression : Expression { private readonly List statements = new List(); diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewArrayExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewArrayExpression.cs index 29a57d5736..da7b1a2e48 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewArrayExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewArrayExpression.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System; using System.Reflection.Emit; - internal class NewArrayExpression : Expression + internal sealed class NewArrayExpression : Expression { private readonly Type arrayType; private readonly int size; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewInstanceExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewInstanceExpression.cs index 679c29adb0..4957adde6e 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewInstanceExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NewInstanceExpression.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class NewInstanceExpression : Expression + internal sealed class NewInstanceExpression : Expression { private readonly Expression[] arguments; private ConstructorInfo constructor; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NopStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NopStatement.cs index 11e1b9e7a9..a65c444af7 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NopStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NopStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class NopStatement : Statement + internal sealed class NopStatement : Statement { public override void Emit(IMemberEmitter member, ILGenerator gen) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullCoalescingOperatorExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullCoalescingOperatorExpression.cs index fb90c24eee..5461130b5e 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullCoalescingOperatorExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullCoalescingOperatorExpression.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System; using System.Reflection.Emit; - internal class NullCoalescingOperatorExpression : Expression + internal sealed class NullCoalescingOperatorExpression : Expression { private readonly Expression @default; private readonly Expression expression; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullExpression.cs index e457eeeae5..6544dbde9f 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/NullExpression.cs @@ -16,11 +16,11 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class NullExpression : Expression + internal sealed class NullExpression : Expression { public static readonly NullExpression Instance = new NullExpression(); - protected NullExpression() + private NullExpression() { } diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferenceExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferenceExpression.cs index 18f4275df1..fd1a5089a4 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferenceExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferenceExpression.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class ReferenceExpression : Expression + internal sealed class ReferenceExpression : Expression { private readonly Reference reference; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferencesToObjectArrayExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferencesToObjectArrayExpression.cs index 8aea198918..9ce9a4ff91 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferencesToObjectArrayExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReferencesToObjectArrayExpression.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class ReferencesToObjectArrayExpression : Expression + internal sealed class ReferencesToObjectArrayExpression : Expression { private readonly TypeReference[] args; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReturnStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReturnStatement.cs index b63c068d37..1d5c820319 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReturnStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ReturnStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class ReturnStatement : Statement + internal sealed class ReturnStatement : Statement { private readonly Expression expression; private readonly Reference reference; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/SelfReference.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/SelfReference.cs index 085d964da1..59eb3fd722 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/SelfReference.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/SelfReference.cs @@ -19,11 +19,11 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection.Emit; [DebuggerDisplay("this")] - internal class SelfReference : Reference + internal sealed class SelfReference : Reference { public static readonly SelfReference Self = new SelfReference(); - protected SelfReference() : base(null) + private SelfReference() : base(null) { } diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ThrowStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ThrowStatement.cs index 664b4a0f5c..0dadaca3f7 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ThrowStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/ThrowStatement.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using System.Reflection; using System.Reflection.Emit; - internal class ThrowStatement : Statement + internal sealed class ThrowStatement : Statement { private readonly string errorMessage; private readonly Type exceptionType; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TryStatement.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TryStatement.cs index 53baea85cc..a25377c29b 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TryStatement.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TryStatement.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST { using System.Reflection.Emit; - internal class TryStatement : Statement + internal sealed class TryStatement : Statement { public override void Emit(IMemberEmitter member, ILGenerator gen) { diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TypeTokenExpression.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TypeTokenExpression.cs index a81dcc011f..6189d7fab0 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TypeTokenExpression.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/SimpleAST/TypeTokenExpression.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators.Emitters.SimpleAST using Castle.DynamicProxy.Tokens; - internal class TypeTokenExpression : Expression + internal sealed class TypeTokenExpression : Expression { private readonly Type type; diff --git a/src/Castle.Core/DynamicProxy/Generators/Emitters/TypeConstructorEmitter.cs b/src/Castle.Core/DynamicProxy/Generators/Emitters/TypeConstructorEmitter.cs index ce0b9a057b..898644fc98 100644 --- a/src/Castle.Core/DynamicProxy/Generators/Emitters/TypeConstructorEmitter.cs +++ b/src/Castle.Core/DynamicProxy/Generators/Emitters/TypeConstructorEmitter.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators.Emitters { using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal class TypeConstructorEmitter : ConstructorEmitter + internal sealed class TypeConstructorEmitter : ConstructorEmitter { internal TypeConstructorEmitter(AbstractTypeEmitter maintype) : base(maintype, maintype.TypeBuilder.DefineTypeInitializer()) diff --git a/src/Castle.Core/DynamicProxy/Generators/ForwardingMethodGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/ForwardingMethodGenerator.cs index 6b7364f6e5..56c39a67aa 100644 --- a/src/Castle.Core/DynamicProxy/Generators/ForwardingMethodGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/ForwardingMethodGenerator.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters; using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal class ForwardingMethodGenerator : MethodGenerator + internal sealed class ForwardingMethodGenerator : MethodGenerator { private readonly GetTargetReferenceDelegate getTargetReference; diff --git a/src/Castle.Core/DynamicProxy/Generators/InheritanceInvocationTypeGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/InheritanceInvocationTypeGenerator.cs index b02d5876e9..e734a79503 100644 --- a/src/Castle.Core/DynamicProxy/Generators/InheritanceInvocationTypeGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/InheritanceInvocationTypeGenerator.cs @@ -22,7 +22,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Tokens; - internal class InheritanceInvocationTypeGenerator : InvocationTypeGenerator + internal sealed class InheritanceInvocationTypeGenerator : InvocationTypeGenerator { public static readonly Type BaseType = typeof(InheritanceInvocation); diff --git a/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithTargetInterfaceGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithTargetInterfaceGenerator.cs index 5b8f9a6683..f6b796a3df 100644 --- a/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithTargetInterfaceGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithTargetInterfaceGenerator.cs @@ -24,7 +24,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Serialization; - internal class InterfaceProxyWithTargetInterfaceGenerator : InterfaceProxyWithTargetGenerator + internal sealed class InterfaceProxyWithTargetInterfaceGenerator : InterfaceProxyWithTargetGenerator { public InterfaceProxyWithTargetInterfaceGenerator(ModuleScope scope, Type targetType, Type[] interfaces, Type proxyTargetType, ProxyGenerationOptions options) diff --git a/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithoutTargetGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithoutTargetGenerator.cs index 164c99b421..d3a68360b0 100644 --- a/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithoutTargetGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/InterfaceProxyWithoutTargetGenerator.cs @@ -23,7 +23,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Serialization; - internal class InterfaceProxyWithoutTargetGenerator : InterfaceProxyWithTargetGenerator + internal sealed class InterfaceProxyWithoutTargetGenerator : InterfaceProxyWithTargetGenerator { public InterfaceProxyWithoutTargetGenerator(ModuleScope scope, Type targetType, Type[] interfaces, Type proxyTargetType, ProxyGenerationOptions options) diff --git a/src/Castle.Core/DynamicProxy/Generators/MetaEvent.cs b/src/Castle.Core/DynamicProxy/Generators/MetaEvent.cs index 7b6b6b21c2..5c82d7c189 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MetaEvent.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MetaEvent.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters; - internal class MetaEvent : MetaTypeElement, IEquatable + internal sealed class MetaEvent : MetaTypeElement, IEquatable { private readonly MetaMethod adder; private readonly MetaMethod remover; diff --git a/src/Castle.Core/DynamicProxy/Generators/MetaMethod.cs b/src/Castle.Core/DynamicProxy/Generators/MetaMethod.cs index cd69018202..31a161c9a3 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MetaMethod.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MetaMethod.cs @@ -19,7 +19,7 @@ namespace Castle.DynamicProxy.Generators using System.Reflection; [DebuggerDisplay("{Method}")] - internal class MetaMethod : MetaTypeElement, IEquatable + internal sealed class MetaMethod : MetaTypeElement, IEquatable { private const MethodAttributes ExplicitImplementationAttributes = MethodAttributes.Virtual | MethodAttributes.Public | diff --git a/src/Castle.Core/DynamicProxy/Generators/MetaProperty.cs b/src/Castle.Core/DynamicProxy/Generators/MetaProperty.cs index 5bde532620..7e35add35d 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MetaProperty.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MetaProperty.cs @@ -21,7 +21,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters; - internal class MetaProperty : MetaTypeElement, IEquatable + internal sealed class MetaProperty : MetaTypeElement, IEquatable { private readonly Type[] arguments; private readonly PropertyAttributes attributes; diff --git a/src/Castle.Core/DynamicProxy/Generators/MetaType.cs b/src/Castle.Core/DynamicProxy/Generators/MetaType.cs index 91cf51150c..a3243311b8 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MetaType.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MetaType.cs @@ -16,7 +16,7 @@ namespace Castle.DynamicProxy.Generators { using System.Collections.Generic; - internal class MetaType + internal sealed class MetaType { private readonly ICollection events = new TypeElementCollection(); private readonly ICollection methods = new TypeElementCollection(); diff --git a/src/Castle.Core/DynamicProxy/Generators/MethodFinder.cs b/src/Castle.Core/DynamicProxy/Generators/MethodFinder.cs index 1fd96aeb79..e98dd18432 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MethodFinder.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MethodFinder.cs @@ -23,7 +23,7 @@ namespace Castle.DynamicProxy.Generators /// Returns the methods implemented by a type. Use this instead of Type.GetMethods() to work around a CLR issue /// where duplicate MethodInfos are returned by Type.GetMethods() after a token of a generic type's method was loaded. /// - internal class MethodFinder + internal sealed class MethodFinder { private static readonly Dictionary cachedMethodInfosByType = new Dictionary(); private static readonly object lockObject = new object(); diff --git a/src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs b/src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs index 87be2ca2f9..6862d9a699 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MethodSignatureComparer.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators using System.Collections.Generic; using System.Reflection; - internal class MethodSignatureComparer : IEqualityComparer + internal sealed class MethodSignatureComparer : IEqualityComparer { public static readonly MethodSignatureComparer Instance = new MethodSignatureComparer(); diff --git a/src/Castle.Core/DynamicProxy/Generators/MethodWithInvocationGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/MethodWithInvocationGenerator.cs index bf264e3e81..5c1b606bfc 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MethodWithInvocationGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MethodWithInvocationGenerator.cs @@ -29,7 +29,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Internal; using Castle.DynamicProxy.Tokens; - internal class MethodWithInvocationGenerator : MethodGenerator + internal sealed class MethodWithInvocationGenerator : MethodGenerator { private readonly IInvocationCreationContributor contributor; private readonly GetTargetExpressionDelegate getTargetExpression; @@ -57,7 +57,7 @@ public MethodWithInvocationGenerator(MetaMethod method, Reference interceptors, this.contributor = contributor; } - protected FieldReference BuildMethodInterceptorsField(ClassEmitter @class, MethodInfo method, INamingScope namingScope) + private FieldReference BuildMethodInterceptorsField(ClassEmitter @class, MethodInfo method, INamingScope namingScope) { var methodInterceptors = @class.CreateField( namingScope.GetUniqueName(string.Format("interceptors_{0}", method.Name)), diff --git a/src/Castle.Core/DynamicProxy/Generators/MinimialisticMethodGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/MinimialisticMethodGenerator.cs index fae27db11a..d1a050441c 100644 --- a/src/Castle.Core/DynamicProxy/Generators/MinimialisticMethodGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/MinimialisticMethodGenerator.cs @@ -20,7 +20,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters; using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal class MinimialisticMethodGenerator : MethodGenerator + internal sealed class MinimialisticMethodGenerator : MethodGenerator { public MinimialisticMethodGenerator(MetaMethod method, OverrideMethodDelegate overrideMethod) : base(method, overrideMethod) diff --git a/src/Castle.Core/DynamicProxy/Generators/NamingScope.cs b/src/Castle.Core/DynamicProxy/Generators/NamingScope.cs index 57958b23ab..adc1fccc2a 100644 --- a/src/Castle.Core/DynamicProxy/Generators/NamingScope.cs +++ b/src/Castle.Core/DynamicProxy/Generators/NamingScope.cs @@ -17,7 +17,7 @@ namespace Castle.DynamicProxy.Generators using System.Collections.Generic; using System.Diagnostics; - internal class NamingScope : INamingScope + internal sealed class NamingScope : INamingScope { private readonly IDictionary names = new Dictionary(); private readonly INamingScope parentScope; diff --git a/src/Castle.Core/DynamicProxy/Generators/OptionallyForwardingMethodGenerator.cs b/src/Castle.Core/DynamicProxy/Generators/OptionallyForwardingMethodGenerator.cs index 6674958c3a..1cc931d84d 100644 --- a/src/Castle.Core/DynamicProxy/Generators/OptionallyForwardingMethodGenerator.cs +++ b/src/Castle.Core/DynamicProxy/Generators/OptionallyForwardingMethodGenerator.cs @@ -21,7 +21,7 @@ namespace Castle.DynamicProxy.Generators using Castle.DynamicProxy.Generators.Emitters; using Castle.DynamicProxy.Generators.Emitters.SimpleAST; - internal class OptionallyForwardingMethodGenerator : MethodGenerator + internal sealed class OptionallyForwardingMethodGenerator : MethodGenerator { // TODO: This class largely duplicates code from Forwarding and Minimalistic generators. Should be refactored to change that private readonly GetTargetReferenceDelegate getTargetReference; diff --git a/src/Castle.Core/DynamicProxy/Generators/TypeElementCollection.cs b/src/Castle.Core/DynamicProxy/Generators/TypeElementCollection.cs index 2dfc4794ec..aa47c92359 100644 --- a/src/Castle.Core/DynamicProxy/Generators/TypeElementCollection.cs +++ b/src/Castle.Core/DynamicProxy/Generators/TypeElementCollection.cs @@ -18,7 +18,7 @@ namespace Castle.DynamicProxy.Generators using System.Collections; using System.Collections.Generic; - internal class TypeElementCollection : ICollection + internal sealed class TypeElementCollection : ICollection where TElement : MetaTypeElement, IEquatable { private readonly ICollection items = new List();