if (pattern.callMethod(ctx, "===", larg).isTrue()) {
synchronized (result) {
result.append(larg);
}
}
for (Variable<IRubyObject> var : getInstanceVariableList()) {
synchronized (this) {
other.setInstanceVariable(var.getName(), var.getValue());
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEnumerable.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java
|
Method name: IRubyObject call(ThreadContext, IRubyObject[], Block)
|
|
Method name: void copyInstanceVariablesInto(InstanceVariables)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (pattern.callMethod(ctx, "===", larg).isTrue()) {↵ | | |
|
2 | ↵ | | 1 | for (Variable<IRubyObject> var : getInstanceVariableList()) {↵
|
3 | synchronized (result) {↵ | | 2 | synchronized (this) {↵
|
4 | result.append(larg);↵ | | 3 | other.setInstanceVariable(var.getName(), var.getValue());↵
|
5 | }↵ | | 4 | ↵
|
6 | ↵ | | 5 | }↵
|
7 | } | | 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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | synchronized (result) | | 2 | synchronized (this) |
| | | 3 | other.setInstanceVariable(var.getName(), var.getValue()); |
4 | | | | |
Precondition Violations (0)
Row |
Violation |