buf.append( tokens[i] ); if ( !isSubselect ) { buf.append( " as " ) .append( NameGenerator.scalarName( c, i ) ); } if ( i != tokens.length - 1 ) buf.append( ", " );
if (tables.length>1) { buf.append("select ").append(column).append(" from "); } buf.append( Table.qualify( catalog, schema, tables[i] ) ); if ( i<tables.length-1) buf.append(" union ");
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/hql/classic/QueryTranslatorImpl.java File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/id/IncrementGenerator.java
Method name: String renderScalarSelect() Method name: void configure(Type, Properties, Dialect)
Number of AST nodes: 5 Number of AST nodes: 5
1
buf.append( tokens[i] );
2
						if ( !isSubselect ) {
3
							buf
1
if (tables.length>1) {
4
.append( " as " )
2
				buf.append("select ").append(column).append(" 
5
									.append( NameGenerator.scalarName( c, i ) );
6
						}
7
						if ( i != token
3
from ");
4
			}
5
			buf.append( Table.qualify( catalog, schema, tables[i] ) );
8
s.length - 1 ) buf.append( ", " );
6
			if ( i<tables.length-1) buf.append(" union ");
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)19.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    39
    buf.append(tokens[i]);
    39
    buf.append(tokens[i]);
    15
    buf.append(Table.qualify(catalog, schema, tables[i]));
    Differences
    Expression1Expression2Difference
    tokens[i]Table.qualify(catalog,schema,tables[i])TYPE_COMPATIBLE_REPLACEMENT
    15
    buf.append(Table.qualify(catalog, schema, tables[i]));
    42
    if (i != tokens.length - 1)
    42
    if (i != tokens.length - 1)
    16
    if (i < tables.length - 1)
    Differences
    Expression1Expression2Difference
    tokenstablesVARIABLE_NAME_MISMATCH
    !=<OPERATOR_MISMATCH
    16
    if (i < tables.length - 1)
    43
    buf.append(", ");
    43
    buf.append(", ");
    17
    buf.append(" union ");
    Differences
    Expression1Expression2Difference
    ", "" union "LITERAL_VALUE_MISMATCH
    17
    buf.append(" union ");
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.hibernate.hql.classic.QueryTranslatorImpl and org.hibernate.id.IncrementGenerator do not have a common superclass