CloneSet629


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
54240.978compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1541
src/NHibernate/Dialect/Function/AnsiExtractFunction.cs
2311
src/NHibernate/Dialect/Function/AnsiTrimFunction.cs
Clone Instance
1
Line Count
54
Source Line
1
Source File
src/NHibernate/Dialect/Function/AnsiExtractFunction.cs

using System;
using System.Text.RegularExpressions;

namespace NHibernate.Dialect.Function
{
        /// <summary>
        /// 
        /// </summary>
        /// <remarks>
        /// <![CDATA[
        /// <extract expression> ::=
        ///                                     EXTRACT <left paren> <extract field> FROM <extract source> <right paren>
        /// 
        ///<extract field > ::=
        ///                     <datetime field> | <time zone field >
        /// 
        /// <datetime field> ::= 
        ///                     YEAR |
        ///                     MONTH |
        ///                     DAY |
        ///                     HOUR |
        ///                     MINUTE |
        ///                     SECOND
        /// 
        ///<time zone field> ::= 
        ///                     TIMEZONE_HOUR   | 
        ///                     TIMEZONE_MINUTE
        /// ]]>
        /// </remarks>
        [Serializable]
        public class AnsiExtractFunction: SQLFunctionTemplate, IFunctionGrammar
        {
                public AnsiExtractFunction()
                        : base(NHibernateUtil.Int32, "extract(?1 ?2 ?3)")
                {
                }

                #region IFunctionGrammar Members

                bool IFunctionGrammar.IsSeparator(string token)
                {
                        return false;
                }

                bool IFunctionGrammar.IsKnownArgument(string token)
                {
                        return Regex.IsMatch(token, "YEAR|MONTH|DAY|HOUR|MINUTE|SECOND|TIMEZONE_HOUR|TIMEZONE_MINUTE|FROM",
                                RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
                }

                #endregion
        }
}


Clone Instance
2
Line Count
31
Source Line
1
Source File
src/NHibernate/Dialect/Function/AnsiTrimFunction.cs

using System;
using System.Text.RegularExpressions;

namespace NHibernate.Dialect.Function
{
        [Serializable]
        public class AnsiTrimFunction : SQLFunctionTemplate, IFunctionGrammar
        {
                public AnsiTrimFunction()
                        : base(NHibernateUtil.String, "trim(?1 ?2 ?3 ?4)")
                {
                }


                #region IFunctionGrammar Members

                bool IFunctionGrammar.IsSeparator(string token)
                {
                        return false;
                }

                bool IFunctionGrammar.IsKnownArgument(string token)
                {
                        return Regex.IsMatch(token, "LEADING|TRAILING|BOTH|FROM",
                                RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
                }

                #endregion
        }
}


Clone AbstractionParameter Count: 4Parameter Bindings

using System;
using System.Text.RegularExpressions;
namespace NHibernate.Dialect.Function
{
   /// <summary>
   /// 
   /// </summary>
   /// <remarks>
   /// <![CDATA[
   /// <extract expression> ::=
   ///                                     EXTRACT <left paren> <extract field> FROM <extract source> <right paren>
   /// 
   ///<extract field > ::=
   ///                     <datetime field> | <time zone field >
   /// 
   /// <datetime field> ::= 
   ///                     YEAR |
   ///                     MONTH |
   ///                     DAY |
   ///                     HOUR |
   ///                     MINUTE |
   ///                     SECOND
   /// 
   ///<time zone field> ::= 
   ///                     TIMEZONE_HOUR   | 
   ///                     TIMEZONE_MINUTE
   /// ]]>
   /// </remarks>
   [Serializable]
   public class [[#variable6ff01480]]: SQLFunctionTemplate, IFunctionGrammar
   {
      public [[#variable6ff01480]](): base(NHibernateUtil. [[#variable6873bc20]], [[#variable6874b160]])
      {
      }

      #region IFunctionGrammar Members
      bool IFunctionGrammar.IsSeparator(string token)
      {
         return false;
      }

      bool IFunctionGrammar.IsKnownArgument(string token)
      {
         return Regex.IsMatch(token, [[#variable6873b9e0]], RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
      }

   #endregion
   }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6ff01480]]
AnsiExtractFunction 
12[[#6ff01480]]
AnsiTrimFunction 
21[[#6873bc20]]
Int32 
22[[#6873bc20]]
String 
31[[#6874b160]]
"extract(?1 ?2 ?3)" 
32[[#6874b160]]
"trim(?1 ?2 ?3 ?4)" 
41[[#6873b9e0]]
"YEAR|MONTH|DAY|HOUR|MINUTE|SECOND|TIMEZONE_HOUR|TIMEZONE_MINUTE|FROM" 
42[[#6873b9e0]]
"LEADING|TRAILING|BOTH|FROM"