while ( results.next() ) {
counter++;
Animal animal = ( Animal ) results.get( 0 );
checkResult( animal );
}
while ( results.previous() ) {
counter++;
Animal animal = ( Animal ) results.get( 0 );
checkResult( animal );
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/hql/ScrollableCollectionFetchingTest.java
|
Method name: void testScrollingJoinFetchesForward()
|
|
Method name: void testScrollingJoinFetchesReverse()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | while ( results.next() ) {↵ | | 1 | while ( results.previous() ) {↵
|
2 | counter++;↵ | | 2 | counter++;↵
|
3 | Animal animal = ( Animal ) results.get( 0 );↵ | | 3 | Animal animal = ( Animal ) results.get( 0 );↵
|
4 | checkResult( animal );↵ | | 4 | checkResult( animal );↵
|
5 | } | | 5 | }
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | while (results.next()) | | 8 | while (results.previous()) |
10 | | | 9 | |
11 | Animal animal = (Animal)results.get(0); | | 10 | Animal animal = (Animal)results.get(0); |
12 | | | 11 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression results.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression results.previous() cannot be parameterized, because it has dependencies to/from statements that will be extracted |