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 ");
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 19.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
39 | buf.append(tokens[i]); | | 15 | buf.append(Table.qualify(catalog, schema, tables[i])); |
42 | if (i != tokens.length - 1) | | 16 | if (i < tables.length - 1) |
43 | | | 17 | |
Precondition Violations (1)
Row |
Violation |
1 | The refactoring of the clones is infeasible, because classes org.hibernate.hql.classic.QueryTranslatorImpl and org.hibernate.id.IncrementGenerator do not have a common superclass |