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 |
| |
See real code fragment | See real code fragment |
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 | 15 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 20.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38 | for (int i = 0; i < tokens.length; i++) |
| 12 | for (int i = 0; i < tables.length; i++) | |||||||||||||||
| 13 | if (tables.length > 1) | |||||||||||||||||
| 14 | buf.append("select ").append(column).append(" from "); | |||||||||||||||||
39 | buf.append(tokens[i]); |
| 15 | buf.append(Table.qualify(catalog, schema, tables[i])); | |||||||||||||||
40 | if (!isSubselect) | | |||||||||||||||||
41 | buf.append(" as ").append(NameGenerator.scalarName(c, i)); |
| | ||||||||||||||||
42 | if (i != tokens.length - 1) |
| 16 | if (i < tables.length - 1) | |||||||||||||||
43 | buf.append(", "); |
| 17 | buf.append(" union "); |
Row | Violation |
---|---|
1 | Expression tokens[i] cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression Table.qualify(catalog,schema,tables[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement buf.append(" as ").append(NameGenerator.scalarName(c,i)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression i != tokens.length - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression i < tables.length - 1 cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Clone fragment #1 returns variables i , while Clone fragment #2 returns variables |
7 | 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 |