<commit_before>using System;
using System.Data;

using NHibernate.Type;
using NHibernate.Engine;
using NHibernate.Loader;

using log4net;

namespace NHibernate.Type {
	/// <summary>
	/// Summary description for CompositeCustomType.
	/// </summary>
	public class CompositeCustomType : AbstractType, IAbstractComponentType {
		private readonly ICompositeUserType userType;
		private readonly string name;

		public CompositeCustomType(System.Type userTypeClass) {

			name = userTypeClass.Name;
		
			try {
				userType = (ICompositeUserType) Activator.CreateInstance(userTypeClass);
			}
			catch (MethodAccessException mae) {
				throw new MappingException( "MethodAccessException trying to instantiate custom type: " + name, mae);
			}
			catch (System.Reflection.TargetInvocationException tie) {
				throw new MappingException( "TargetInvocationException trying to instantiate custom type: " + name, tie);
			}
			catch (ArgumentException ae) {
				throw new MappingException( "ArgumentException trying to instantiate custom type: " + name, ae);
			}
			catch (InvalidCastException ice) {
				throw new MappingException( name + " must implement NHibernate.ICompositeUserType", ice);
			}
			if ( !userType.ReturnedClass.IsSerializable )  {
				LogManager.GetLogger( typeof(CustomType) ).Warn("custom type does not implement Serializable: " + userTypeClass);
			}
		}			

		public IType[] Subtypes {
			get {
				return userType.PropertyTypes;
			}
		}

		public string[] PropertyNames {
			get {
				return userType.PropertyNames;
			}
		}

		public object[] GetPropertyValues(object component, ISessionImplementor session) {
			int len = Subtypes.Length;
			object[] result = new object[len];
			for ( int i=0; i<len; i++ ) {
				result[i] = GetPropertyValue(component, i, session);
			}
			return result;
		}

		public void SetPropertyValues(Object component, Object[] values) {
			for (int i=0; i<values.Length; i++) {
				userType.SetPropertyValue( component, i, values[i] );
			}
		}

		public object GetPropertyValue(object component, int i, ISessionImplementor session) {
			return userType.GetPropertyValue(component, i);
		}

		public Cascades.CascadeStyle Cascade(int i) {
			return Cascades.CascadeStyle.StyleNone;
		}


		public OuterJoinLoaderType EnableJoinedFetch(int i) {
			return OuterJoinLoaderType.Auto;
		}

		public override bool IsComponentType {
			get { return true; }
		}

		public override object Assemble(object cached, ISessionImplementor session,
			object owner) {
			return userType.Assemble(cached, session, owner);
		}

		public override object DeepCopy(object value) {
			return userType.DeepCopy(value);
		}

		public override object Disassemble(object value, ISessionImplementor session) {
			return userType.Disassemble(value, session);
		}

		public override bool Equals(object x, object y) {
			return userType.Equals(x, y);<commit_msg>Fix virtual keyword<commit_after>using System;
using System.Data;

using NHibernate.Type;
using NHibernate.Engine;
using NHibernate.Loader;

using log4net;

namespace NHibernate.Type {
	/// <summary>
	/// Summary description for CompositeCustomType.
	/// </summary>
	public class CompositeCustomType : AbstractType, IAbstractComponentType {
		private readonly ICompositeUserType userType;
		private readonly string name;

		public CompositeCustomType(System.Type userTypeClass) {

			name = userTypeClass.Name;
		
			try {
				userType = (ICompositeUserType) Activator.CreateInstance(userTypeClass);
			}
			catch (MethodAccessException mae) {
				throw new MappingException( "MethodAccessException trying to instantiate custom type: " + name, mae);
			}
			catch (System.Reflection.TargetInvocationException tie) {
				throw new MappingException( "TargetInvocationException trying to instantiate custom type: " + name, tie);
			}
			catch (ArgumentException ae) {
				throw new MappingException( "ArgumentException trying to instantiate custom type: " + name, ae);
			}
			catch (InvalidCastException ice) {
				throw new MappingException( name + " must implement NHibernate.ICompositeUserType", ice);
			}
			if ( !userType.ReturnedClass.IsSerializable )  {
				LogManager.GetLogger( typeof(CustomType) ).Warn("custom type does not implement Serializable: " + userTypeClass);
			}
		}			

		public virtual IType[] Subtypes {
			get {
				return userType.PropertyTypes;
			}
		}

		public virtual string[] PropertyNames {
			get {
				return userType.PropertyNames;
			}
		}

		public virtual object[] GetPropertyValues(object component, ISessionImplementor session) {
			int len = Subtypes.Length;
			object[] result = new object[len];
			for ( int i=0; i<len; i++ ) {
				result[i] = GetPropertyValue(component, i, session);
			}
			return result;
		}

		public virtual void SetPropertyValues(Object component, Object[] values) {
			for (int i=0; i<values.Length; i++) {
				userType.SetPropertyValue( component, i, values[i] );
			}
		}

		public virtual object GetPropertyValue(object component, int i, ISessionImplementor session) {
			return userType.GetPropertyValue(component, i);
		}

		public virtual Cascades.CascadeStyle Cascade(int i) {
			return Cascades.CascadeStyle.StyleNone;
		}


		public virtual OuterJoinLoaderType EnableJoinedFetch(int i) {
			return OuterJoinLoaderType.Auto;
		}

		public override bool IsComponentType {
			get { return true; }
		}

		public override object Assemble(object cached, ISessionImplementor session,
			object owner) {
			return userType.Assemble(cached, session, owner);
		}

		public override object DeepCopy(object value) {
			return userType.DeepCopy(value);
		}

		public override object Disassemble(object value, ISessionImplementor session) {
			return userType.Disassemble(value, session);
		}

		public override bool Equals(object x, object y) {
			return userType.Equals(x, y);
{'fraction_non_alphanumeric': 0.09212787899621863, 'fraction_numerical': 0.0010312822275696115, 'mean_word_length': 4.140459363957597, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '241080', 'n_tokens_mistral': 1988, 'n_tokens_neox': 1685, 'n_words': 462}