| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 38 | 2 | 0 | 1.000 | statement_list[3] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 39 | 1354 | src/NHibernate/Hql/Classic/QueryTranslator.cs |
| 2 | 38 | 78 | src/NHibernate/Hql/QuerySplitter.cs |
| ||||
string token = tokens[i];
if ( !ParserHelper.IsWhitespace(token) || last == null)
{
// scan for the next non-whitespace token
if (nextIndex <= i)
{
for (nextIndex = i + 1; nextIndex < tokens.Length; nextIndex++)
{
next = tokens[nextIndex].ToLowerInvariant();
if ( !ParserHelper.IsWhitespace(next))
{
break;
}
}
}
//if ( Character.isUpperCase( token.charAt( token.lastIndexOf(".") + 1 ) ) ) {
// added the checks for last!=null and next==null because an ISet can not contain
// a null key in .net - it is valid for a null key to be in a java.util.Set
if (
((last != null && beforeClassTokens.Contains(last)) && (next == null || !notAfterClassTokens.Contains(next))) ||
PathExpressionParser.EntityClass.Equals(last))
{
System.Type clazz = helper.GetImportedClass(token);
if (clazz != null)
{
string[] implementors = factory.GetImplementors(clazz.FullName);
string placeholder = "$clazz" + count++ + "$";
if (implementors != null)
{
placeholders.Add(placeholder);
replacements.Add(implementors);
}
token = placeholder; //Note this!!
}
}
}
templateQuery.Append(token);
|
| ||||
string token = tokens[i];
if ( !ParserHelper.IsWhitespace(token) || last == null)
{
//scan for next non-whitespace token
if (nextIndex <= i)
{
for (nextIndex = i + 1; nextIndex < tokens.Length; nextIndex++)
{
next = tokens[nextIndex].ToLowerInvariant();
if ( !ParserHelper.IsWhitespace(next))
{
break;
}
}
}
// TODO H3.2 Different behavior
// NHb: This block is not an exactly port from H3.2 but a port from previous implementation of QueryTranslator
if (((last != null && beforeClassTokens.Contains(last)) &&
(next == null || !notAfterClassTokens.Contains(next))) ||
PathExpressionParser.EntityClass.Equals(last))
{
System.Type clazz = helper.GetImportedClass(token);
if (clazz != null)
{
string[] implementors = factory.GetImplementors(clazz.FullName);
string placeholder = "$clazz" + count++ + "$";
if (implementors != null)
{
placeholders.Add(placeholder);
replacements.Add(implementors);
}
token = placeholder; //Note this!!
}
}
}
templateQuery.Append(token);
|
| |||
string token = tokens[i];
if ( !ParserHelper.IsWhitespace(token) || last == null)
{
//scan for next non-whitespace token
// scan for the next non-whitespace token
if (nextIndex <= i)
{
for (nextIndex = i + 1; nextIndex < tokens.Length; nextIndex++)
{
next = tokens[nextIndex].ToLowerInvariant();
if ( !ParserHelper.IsWhitespace(next))
{
break;
}
}
}
// TODO H3.2 Different behavior
// NHb: This block is not an exactly port from H3.2 but a port from previous implementation of QueryTranslator
//if ( Character.isUpperCase( token.charAt( token.lastIndexOf(".") + 1 ) ) ) {
// added the checks for last!=null and next==null because an ISet can not contain
// a null key in .net - it is valid for a null key to be in a java.util.Set
if (((last != null && beforeClassTokens.Contains(last)) && (next == null || !notAfterClassTokens.Contains(next))) || PathExpressionParser.EntityClass.Equals(last))
{
System.Type clazz = helper.GetImportedClass(token);
if (clazz != null)
{
string[] implementors = factory.GetImplementors(clazz.FullName);
string placeholder = "$clazz" + count++ + "$";
if (implementors != null)
{
placeholders.Add(placeholder);
replacements.Add(implementors);
}
token = placeholder; //Note this!!
}
}
}
templateQuery.Append(token);
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| None | |||