for ( int i = 0; i < tokens.length; i++ ) { buf.append( tokens[i] ); if ( !isSubselect ) { buf.append( " as " ) .append( NameGenerator.scalarName( c, i ) ); } if ( i != tokens.length - 1 ) buf.append( ", " ); }
for ( int i=0; i<tables.length; i++ ) { 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: 6 Number of AST nodes: 6
1
for ( int i = 0; i < tokens.length; i++ ) {
1
for ( int i=0; i<tables.length; i++ ) {
2
						buf.append( tokens[i] );
2
			
3
						if ( !isSubselect ) {
4
							buf
3
if (tables.length>1) {
5
.append( " as " )
4
				buf.append("select ").append(column).append(" from ");
6
			
5
			}
7
						.append( NameGenerator.scalarName( c, i ) );
6
			buf.append( 
8
						}
9
						if ( i != token
7
Table.qualify( catalog, schema, tables[i] ) );
10
s.length - 1 ) buf.append( ", " );
8
			if ( i<tables.length-1) buf.append(
11
			
9
" union ");
12
		}
10
		}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons4