for (int i = 0; i < sourceArray.length; i++) {
method.dup();
method.pushInt(i);
callback.nextValue(this, sourceArray, i);
method.arraystore();
}
for (int i = 0; i < sourceArray.length; i++) {
method.dup();
method.pushInt(i);
callback.nextValue(this, sourceArray, i);
method.arraystore();
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java
|
|
File path: /jruby-1.4.0/src/org/jruby/compiler/impl/BaseBodyCompiler.java
|
Method name: void buildObjectArray(String, Object[], ArrayCallback)
|
|
Method name: void buildRubyArray(Object[], ArrayCallback, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int i = 0; i < sourceArray.length; i++) {↵ | | 1 | for (int i = 0; i < sourceArray.length; i++) {↵
|
2 | method.dup();↵ | | 2 | method.dup();↵
|
3 | method.pushInt(i);↵ | | 3 | method.pushInt(i);↵
|
|
4 | callback.nextValue(this, sourceArray, i);↵ | | 4 | callback.nextValue(this, sourceArray, i);↵
|
|
5 | method.arraystore();↵ | | 5 | method.arraystore();↵
|
6 | } | | 6 | }
|
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.7 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 29 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
9 | for (int i = 0; i < sourceArray.length; i++) | | 9 | for (int i = 0; i < sourceArray.length; i++) |
10 | | | 10 | |
11 | | | 11 | |
12 | callback.nextValue(this, sourceArray, i); | | 12 | callback.nextValue(this, sourceArray, i); |
13 | | | 13 | |
Precondition Violations (0)
Row |
Violation |