if ( selectLength == row.length ) {
return row;
}
else {
Object[] result = new Object[selectLength];
int j = 0;
for ( int i = 0; i < row.length; i++ ) {
if ( includeInSelect[i] ) result[j++] = row[i];
}
return result;
}
if ( selectLength == row.length ) {
return row;
}
else {
Object[] result = new Object[selectLength];
int j = 0;
for ( int i = 0; i < row.length; i++ ) {
if ( includeInSelect[i] ) {
result[j++] = row[i];
}
}
return result;
}
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/loader/hql/QueryLoader.java
|
Method name: Object[] toResultRow(Object[])
|
|
Method name: Object[] toResultRow(Object[])
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if ( selectLength == row.length ) {↵ | | 1 | if ( selectLength == row.length ) {↵
|
2 | return row;↵ | | 2 | return row;↵
|
3 | }↵ | | 3 | }↵
|
4 | else {↵ | | 4 | else {↵
|
5 | Object[] result = new Object[selectLength];↵ | | 5 | Object[] result = new Object[selectLength];↵
|
6 | int j = 0;↵ | | 6 | int j = 0;↵
|
7 | for ( int i = 0; i < row.length; i++ ) {↵ | | 7 | for ( int i = 0; i < row.length; i++ ) {↵
|
8 | if ( includeInSelect[i] ) ↵ | | 8 | if ( includeInSelect[i] ) {↵
|
9 | result[j++] = row[i];↵ | | 9 | result[j++] = row[i];↵
|
10 | ↵ | | 10 | }↵
|
11 | }↵ | | 11 | }↵
|
12 | return result;↵ | | 12 | return result;↵
|
13 | } | | 13 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 30 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 2.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (selectLength == row.length) | | 1 | if (selectLength == row.length) |
2 | | | 2 | |
| | | | |
3 | Object[] result = new Object[selectLength]; | | 3 | Object[] result = new Object[selectLength]; |
4 | | | 4 | |
5 | for (int i = 0; i < row.length; i++) | | 5 | for (int i = 0; i < row.length; i++) |
6 | | | 6 | |
7 | | | 7 | |
8 | | | 8 | |
Precondition Violations (1)
Row |
Violation |
1 | Not all possible execution flows end in a return statement |