<commit_before>using System;
using System.Data;
using NHibernate.SqlTypes;

namespace NHibernate.Type
{
	/// <summary>
	/// Maps a <see cref="System.Boolean"/> Property 
	/// to a <see cref="DbType.Boolean"/> column.
	/// </summary>
	public class BooleanType : ValueTypeType, IDiscriminatorType
	{
		private const string TRUE = "1";
		private const string FALSE = "0";

		/// <summary>
		/// Initialize a new instance of the BooleanType
		/// </summary>
		/// <remarks>This is used when the Property is mapped to a native boolean type.</remarks>
		internal BooleanType() : base( new BooleanSqlType() )
		{
		}

		/// <summary>
		/// Initialize a new instance of the BooleanType class using a
		/// <see cref="AnsiStringFixedLengthSqlType"/>.
		/// </summary>
		/// <param name="sqlType">The underlying <see cref="SqlType"/>.</param>
		/// <remarks>
		/// This is used when the Property is mapped to a string column
		/// that stores true or false as a string.
		/// </remarks>
		internal BooleanType( AnsiStringFixedLengthSqlType sqlType ) : base( sqlType )
		{
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="rs"></param>
		/// <param name="index"></param>
		/// <returns></returns>
		public override object Get( IDataReader rs, int index )
		{
			return Convert.ToBoolean( rs[ index ] );
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="rs"></param>
		/// <param name="name"></param>
		/// <returns></returns>
		public override object Get( IDataReader rs, string name )
		{
			return Convert.ToBoolean( rs[ name ] );
		}

		/// <summary>
		/// 
		/// </summary>
		public System.Type PrimitiveClass
		{
			get { return typeof( bool ); }
		}

		/// <summary>
		/// 
		/// </summary>
		public override System.Type ReturnedClass
		{
			get { return typeof( bool ); }
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="cmd"></param>
		/// <param name="value"></param>
		/// <param name="index"></param>
		public override void Set( IDbCommand cmd, object value, int index )
		{
			( ( IDataParameter ) cmd.Parameters[ index ] ).Value = ( bool ) value;
		}

		/// <summary></summary>
		public override string Name
		{
			get { return "Boolean"; }
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="value"></param>
		/// <returns></returns>
		public override string ObjectToSQLString( object value )
		{
			return ( ( bool ) value ) ? TRUE : FALSE;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="xml"></param>
		/// <returns></returns>
		public virtual object StringToObject( string xml )
		{
			return FromString( xml );
		}

		public override object FromStringValue(string xml)
		{
			return bool.Parse( xml );
		}

	}
}<commit_msg>Removed empty comments<commit_after>using System;
using System.Data;
using NHibernate.SqlTypes;

namespace NHibernate.Type
{
	/// <summary>
	/// Maps a <see cref="System.Boolean"/> Property 
	/// to a <see cref="DbType.Boolean"/> column.
	/// </summary>
	public class BooleanType : ValueTypeType, IDiscriminatorType
	{
		private const string TRUE = "1";
		private const string FALSE = "0";

		/// <summary>
		/// Initialize a new instance of the BooleanType
		/// </summary>
		/// <remarks>This is used when the Property is mapped to a native boolean type.</remarks>
		internal BooleanType() : base( new BooleanSqlType() )
		{
		}

		/// <summary>
		/// Initialize a new instance of the BooleanType class using a
		/// <see cref="AnsiStringFixedLengthSqlType"/>.
		/// </summary>
		/// <param name="sqlType">The underlying <see cref="SqlType"/>.</param>
		/// <remarks>
		/// This is used when the Property is mapped to a string column
		/// that stores true or false as a string.
		/// </remarks>
		internal BooleanType( AnsiStringFixedLengthSqlType sqlType ) : base( sqlType )
		{
		}

		public override object Get( IDataReader rs, int index )
		{
			return Convert.ToBoolean( rs[ index ] );
		}

		public override object Get( IDataReader rs, string name )
		{
			return Convert.ToBoolean( rs[ name ] );
		}

		public System.Type PrimitiveClass
		{
			get { return typeof( bool ); }
		}

		public override System.Type ReturnedClass
		{
			get { return typeof( bool ); }
		}

		public override void Set( IDbCommand cmd, object value, int index )
		{
			( ( IDataParameter ) cmd.Parameters[ index ] ).Value = ( bool ) value;
		}

		public override string Name
		{
			get { return "Boolean"; }
		}

		public override string ObjectToSQLString( object value )
		{
			return ( ( bool ) value ) ? TRUE : FALSE;
		}

		public virtual object StringToObject( string xml )
		{
			return FromString( xml );
		}

		public override object FromStringValue(string xml)
		{
			return bool.Parse( xml );
		}
	}
}
{'fraction_non_alphanumeric': 0.15389527458492977, 'fraction_numerical': 0.0008514261387824606, 'mean_word_length': 2.662509742790335, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '6940833', 'n_tokens_mistral': 1635, 'n_tokens_neox': 1432, 'n_words': 437}