final RubyArray result = RubyArray.newArray(runtime, size); visitAll(new Visitor() { public void visit(IRubyObject key, IRubyObject value) { result.append(RubyArray.newArray(runtime, key, value)); } }); result.setTaint(isTaint()); return result;
final RubyArray values = RubyArray.newArray(getRuntime(), size); visitAll(new Visitor() { public void visit(IRubyObject key, IRubyObject value) { values.append(value); } }); return values;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyHash.java File path: /jruby-1.4.0/src/org/jruby/RubyHash.java
Method name: RubyArray to_a() Method name: RubyArray rb_values()
Number of AST nodes: 4 Number of AST nodes: 3
1
final RubyArray result = RubyArray.newArray(runtime, size);
1
final RubyArray values = RubyArray.newArray(getRuntime(), size);
2
            visitAll(new Visitor() {
2
            visitAll(new Visitor() {
3
                public void visit(IRubyObject key, IRubyObject value) {
3
                public void visit(IRubyObject key, IRubyObject value) {
4
                    result.append(RubyArray.newArray(runtime, key, value));
4
                    values.append(value);
5
                }
5
                }
6
            });
6
            });
7
            result.setTaint(isTaint());
7
            re
8
            return result;
8
turn values;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    final RubyArray result = RubyArray.newArray(runtime, size);
    3
    final RubyArray result = RubyArray.newArray(runtime, size);
    2
    final RubyArray values = RubyArray.newArray(getRuntime(), size);
    Differences
    Expression1Expression2Difference
    resultvaluesVARIABLE_NAME_MISMATCH
    runtimegetRuntime()TYPE_COMPATIBLE_REPLACEMENT
    2
    final RubyArray values = RubyArray.newArray(getRuntime(), size);
    6
    return result;
    6
    return result;
    4
    return values;
    Differences
    Expression1Expression2Difference
    resultvaluesVARIABLE_NAME_MISMATCH
    4
    return values;
    Precondition Violations (0)
    Row Violation