CloneSet405


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
14220.994statement_list[10]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1141332
src/NHibernate/Hql/Classic/QueryTranslator.cs
21451
src/NHibernate/Hql/QuerySplitter.cs
Clone Instance
1
Line Count
14
Source Line
1332
Source File
src/NHibernate/Hql/Classic/QueryTranslator.cs

                        // TODO H3.2 check if the QuerySplitter can do the work (this method is not present in H3.2)

                        //scan the query string for class names appearing in the from clause and replace 
                        //with all persistent implementors of the class/interface, returning multiple 
                        //query strings (make sure we don't pick up a class in the select clause!) 

                        //TODO: this is one of the ugliest and most fragile pieces of code in Hibernate...
                        string[] tokens = StringHelper.Split(ParserHelper.Whitespace + "(),", query, true);
                        if (tokens.Length == 0)
                        {
                                return new String[] { query
                                                    } ;
                        } // just especially for the trivial collection filter 
                        ArrayList placeholders = new ArrayList();
                        ArrayList replacements = new ArrayList();
                        StringBuilder templateQuery = new StringBuilder(40);
                        int count = 0;
                        string last = null;
                        int nextIndex = 0;
                        string next = null;
                        templateQuery.Append(tokens[0]);


Clone Instance
2
Line Count
14
Source Line
51
Source File
src/NHibernate/Hql/QuerySplitter.cs

                        string[] tokens = StringHelper.Split(StringHelper.WhiteSpace + "(),", query, true);
                        if (tokens.Length == 0)
                        {
                                return new String[] { query
                                                    } ;      // just especially for the trivial collection filter
                        }
                        ArrayList placeholders = new ArrayList();
                        ArrayList replacements = new ArrayList();
                        StringBuilder templateQuery = new StringBuilder(40);
                        int count = 0;
                        string last = null;
                        int nextIndex = 0;
                        string next = null;
                        templateQuery.Append(tokens[0]);


Clone AbstractionParameter Count: 2Parameter Bindings

// TODO H3.2 check if the QuerySplitter can do the work (this method is not present in H3.2)
//scan the query string for class names appearing in the from clause and replace 
//with all persistent implementors of the class/interface, returning multiple 
//query strings (make sure we don't pick up a class in the select clause!) 
//TODO: this is one of the ugliest and most fragile pieces of code in Hibernate...
string[] tokens = StringHelper.Split( [[#variable6b500760]]. [[#variable6b500740]]+ "(),", query, true);
if (tokens.Length == 0)
{
   return new String[]
          {
             query
          } ; // just especially for the trivial collection filter
} // just especially for the trivial collection filter 
ArrayList placeholders = new ArrayList();
ArrayList replacements = new ArrayList();
StringBuilder templateQuery = new StringBuilder(40);
int count = 0;
string last = null;
int nextIndex = 0;
string next = null;
templateQuery.Append(tokens[0]);
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6b500760]]
ParserHelper 
12[[#6b500760]]
StringHelper 
21[[#6b500740]]
Whitespace 
22[[#6b500740]]
WhiteSpace