File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/ANSIJoinFragment.java | File path: /hibernate-distribution-3.3.2.GA/project/core/src/main/java/org/hibernate/sql/ConditionFragment.java | |||
Method name: void addJoin(String, String, String[], String[], int, String)
|
Method name: String toFragmentString()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | for ( int j=0; j<fkColumns.length; j++) {↵ | 1 | for ( int i=0; i<lhs.length; i++↵ | |
2 | /*if ( fkColumns[j].indexOf('.')<1 ) {↵ | |||
3 | throw new AssertionFailure("missing alias");↵ | |||
4 | }*/↵ | |||
5 | buffer.append( fkColumns[j] ↵ | 2 | ) {↵ | |
6 | )↵ | 3 | buf.append(tableAlias)↵ | |
7 | .append('=')↵ | 4 | .append('.')↵ | |
8 | .append(alias)↵ | 5 | .append( lhs[i] )↵ | |
9 | .append('.')↵ | 6 | .append(op)↵ | |
10 | .append( pkColumns[j] );↵ | 7 | .append( rhs[i] );↵ | |
11 | if ( j<fkColumns.length-1 ) buffer.append(" and ");↵ | 8 | if (i<lhs.length-1) buf.append(" and ");↵ | |
12 | } | 9 |
| |
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 4.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18 | for (int j = 0; j < fkColumns.length; j++) |
| 2 | for (int i = 0; i < lhs.length; i++) | |||||||||||||||||||
|
| 3 | buf.append(tableAlias).append('.').append(lhs[i]).append(op).append(rhs[i]); | ||||||||||||||||||||
19 | buffer.append(fkColumns[j]).append('=').append(alias).append('.').append(pkColumns[j]); |
| | ||||||||||||||||||||
20 | if (j < fkColumns.length - 1) |
| 4 | if (i < lhs.length - 1) | |||||||||||||||||||
21 | buffer.append(" and "); |
| 5 | buf.append(" and "); |
Row | Violation |
---|---|
1 | Unmatched statement buf.append(tableAlias).append('.').append(lhs[i]).append(op).append(rhs[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement buffer.append(fkColumns[j]).append('=').append(alias).append('.').append(pkColumns[j]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |