for ( int i=0; i<n; i++ ) {
simples[i] = new Simple();
simples[i].init();
simples[i].setCount(i);
ids[i] = new Long(i);
s.save(simples[i], ids[i]);
}
for ( int i=0; i<n; i++ ) {
simples[i] = new Simple();
simples[i].init();
simples[i].setCount(i);
ids[i] = new Long(i);
}
Clone fragments detected by clone detection tool
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/perf/org/hibernate/test/perf/NewerPerformanceTest.java
|
|
File path: /hibernate-distribution-3.3.2.GA/project/testsuite/src/test/perf/org/hibernate/test/perf/PerformanceTest.java
|
Method name: void testSimultaneous()
|
|
Method name: void testMany()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | for ( int i=0; i<n; i++ ) {↵ | | 1 | for ( int i=0; i<n; i++ ) {↵
|
2 | simples[i] = new Simple();↵ | | 2 | simples[i] = new Simple();↵
|
3 | simples[i].init();↵ | | 3 | simples[i].init();↵
|
4 | simples[i].setCount(i);↵ | | 4 | simples[i].setCount(i);↵
|
5 | ids[i] = new Long(i);↵ | | 5 | ids[i] = new Long(i);↵
|
6 | s.save(simples[i], ids[i]);↵ | | 6 | ↵
|
7 | } | | 7 | }
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 33 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | for (int i = 0; i < n; i++) | | 7 | for (int i = 0; i < n; i++) |
9 | simples[i] = new Simple(); | | 8 | simples[i] = new Simple(); |
10 | | | 9 | |
11 | | | 10 | |
12 | | | 11 | |
13 | s.save(simples[i], ids[i]); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched statement s.save(simples[i],ids[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Clone fragment #1 returns variables i, simples, ids , while Clone fragment #2 returns variables simples, ids |