long time = System.currentTimeMillis();
for (int i = 0; i < loops; i++) {
o.getName("Charlie");
}
System.out.println("took: " + (System.currentTimeMillis() - time));
long time = System.currentTimeMillis();
for (int i = 0; i < loops; i++) {
o.foo("Charlie");
}
System.out.println("took: " + (System.currentTimeMillis() - time));
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/test/org/jruby/test/OverloadedTest.java
|
|
File path: /jruby-1.4.0/test/org/jruby/test/OverloadedTest.java
|
Method name: void testOverloaded(Overloaded, int)
|
|
Method name: void testOverloaded2(Overloaded, int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | long time = System.currentTimeMillis();↵ | | 1 | long time = System.currentTimeMillis();↵
|
2 | for (int i = 0; i < loops; i++) {↵ | | 2 | for (int i = 0; i < loops; i++) {↵
|
3 | o.getName("Charlie");↵ | | 3 | o.foo("Charlie");↵
|
4 | }↵ | | 4 | }↵
|
5 | System.out.println("took: " + (System.currentTimeMillis() - time)); | | 5 | System.out.println("took: " + (System.currentTimeMillis() - time));
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | long time = System.currentTimeMillis(); | | 1 | long time = System.currentTimeMillis(); |
2 | for (int i = 0; i < loops; i++) | | 2 | for (int i = 0; i < loops; i++) |
| | | 3 | |
3 | | | | |
4 | System.out.println("took: " + (System.currentTimeMillis() - time)); | | 4 | System.out.println("took: " + (System.currentTimeMillis() - time)); |
Precondition Violations (0)
Row |
Violation |